Commit Graph

58663 Commits

Author SHA1 Message Date
John Baldwin
fea3efe5bf Implement rw_try_upgrade() and rw_downgrade(). rw_try_upgrade() makes a
single attempt at upgrading a read lock to a write lock, and rw_downgrade()
converts curthread's write lock into a read lock.
2006-04-19 21:06:52 +00:00
Paul Saab
ee626b40c0 Free some previously leaked memory on module unload. 2006-04-19 19:56:10 +00:00
Marcel Moolenaar
634da1d0b2 Remove sab(4). 2006-04-19 19:39:35 +00:00
Warner Losh
ae78672c56 MFp4 (checkpoint of work in progress):
o Use a directory layout that is more akin to the i386 boot layout.
o Create a libat91 for library routines that are used by one or more
  of the boot loaders.
o Create bootiic for booting from an iic part.
o Create bootspi for booting from an spi part.
o Optimize the size of many of these routines (especially emac.c).  Except
  for the emac.c optimizations, all these have been tested.
o eliminate the inc directory, libat91 superceeds it.
o Move linker.cfg up a layer to allow it to be shared.
2006-04-19 17:16:49 +00:00
Colin Percival
2652af563e Correct a local information leakage bug affecting AMD FPUs.
Security:	FreeBSD-SA-06:14.fpu
2006-04-19 07:00:19 +00:00
Matt Jacob
a20d25c0d0 Fxi tpyo.
Noticed by: maxim
2006-04-18 22:43:46 +00:00
Matt Jacob
af60634800 Add ISP_DEFAULT_ROLES as a config option. 2006-04-18 22:24:55 +00:00
Matt Jacob
9dcfabf816 Actually check to see if XPT_CALC_GEOMETRY had an error
and pick a bogus geometry if it had so we don't later
get a divide by zero trap.
2006-04-18 22:01:59 +00:00
Matt Jacob
5b9fdd582c Update 2300 f/w. This will probably be the last
update here before we switch to the new f/w loading
framework.
2006-04-18 21:55:30 +00:00
Matt Jacob
bae3cbf075 Do more guarding against zero divide traps for the geom subroutine. 2006-04-18 21:53:39 +00:00
Matt Jacob
2901a7b7d4 In receiving a new ATIO, don't record the associated CCB in the target
state structure. This field is only for CCBs that are associated with
actions that are occurring on the HBA (i.e., XPT_CONT_IO actions).

This way we also don't get confused when the upstream listener stalls
try and look at a CCB which has already been freed (by CAM).
2006-04-18 21:52:00 +00:00
Wojciech A. Koszek
5884c1a098 'owner' is not used without SMP. Fix kernel build for such kernel
configurations.

Approved by:	jhb
2006-04-18 20:32:42 +00:00
Peter Wemm
714d4fe9b6 If we're doing a try-alloc of a pv entry and give up early, do not forget
to reduce the pv_entry_count counter.  This was found by Tor Egge.  In the
same email, Tor also pointed out the pv_stats problem in the previous
commit, but I'd forgotten about it until I went looking for this email
about this allocation problem.
2006-04-18 20:17:32 +00:00
Peter Wemm
bac58593f1 pv_entry_count is more than a statistic. It is used for resource limiting.
Do not compile out its counter updates if pv entry stats are turned off.
2006-04-18 20:11:00 +00:00
John Baldwin
efa86db61d Adaptively spin before blocking on the turnstile if an rwlock is write
locked.  In general the adaptive spinning is similar to the same code
for mutexes with some extra trickiness in rw_wunlock_hard().  Specifically,
even though both wait bits might be set and we might have a turnstile with
at least one waiting thread, there might not be any threads blocked on the
queue we are not waking up (they might all be spinning), and we should
only preserve the waiting flag for the queue we aren't waking up if there
are in fact threads blocked on that queue.  Secondly, there might not be
any threads blocked on the queue we have chosen to waken threads from
(there might only be threads blocked on the other queue and the threads
for this queue are all spinning) in which case we disown the turnstile
instead of doing a braodcast and unpend.
2006-04-18 18:27:54 +00:00
John Baldwin
62375b03cd Update comments to mention that each turnstile contains two queues and to
describe turnstile_disown() and turnstile_empty().
2006-04-18 18:21:38 +00:00
John Baldwin
f1a4b852dc - Bring back turnstile_empty() which can check to see if an individual
queue on a turnstile is empty.
- Add a turnstile_disown() function that allows a thread to give up
  ownership of a turnstile w/o waking up any waiters.
2006-04-18 18:16:54 +00:00
Pawel Jakub Dawidek
c082905bb6 Fix storing offset of already synchronized data. Offset in entire array was
stored in metadata instead of an offset in single disk.
After reboot/crash synchronization process started from a wrong offset
skipping (not synchronizing) part of the component which can lead to data
corrutpion (when synchronization process was interrupted on initial
synchronization) or other strange situations like 'graid3 status' showing
value more than 100%.

Reported, reviewed and tested by:	ru
Reported by:	Dmitry Morozovsky <marck@rinet.ru>
MFC after:	1 day
2006-04-18 13:52:11 +00:00
Darren Reed
649a43212c fix "ipf -Z" reporting rubbish and possibly panic'ing box
MFC after:	4 days
2006-04-18 13:24:14 +00:00
Gleb Smirnoff
4cbb118526 Merge rev. 1.240 of ip_output.c, so that IPFIREWALL_FORWARD_EXTENDED
kernel option will affect both forwarding methods - classic and fast.
2006-04-18 09:20:16 +00:00
Xin LI
4207c279d4 In vfs_hash_get(): mount point should never be changed
so explicitly constify the mp parameter.

Reviewed by:	phk
2006-04-18 08:05:08 +00:00
Eric Anholt
a3f4c74951 Reorder the DRM_*_AGP enums to match linux and what our code expects, fixing
i915 attachment.

Submitted by:	Jonathan Fosburgh <jonathan@fosburgh.org>
2006-04-18 06:14:43 +00:00
John-Mark Gurney
5231b1cda8 remove DRIVER_MODULE lines that are useless... pcf doesn't exist (only
as pcf_ebus and pcf_isa, they should probably be fixed back to pcf),
and bti2c doesn't exist, bktr has smbus or iicbb as children..

Brought to you by: http://people.FreeBSD.org/~jmg/driver.pdf
2006-04-17 22:33:42 +00:00
John Baldwin
38bf165fa1 - Add a rw_wowner() macro that just returns the owner of a write lock and
use it in places that only care about the write owner instead of
  rw_owner() as a baby step towards limited read-lock owner.
- Tidy the code that sets the WAITER flag bits to not duplicate a test
  around the atomic operation and the KTR trace in both of the lock
  functions.
2006-04-17 21:11:01 +00:00
Marius Strobl
338199fe88 - Since critical sections no longer raise the processor interrupt level to
above what's used for fast interrupts, only interrupts with the level of
  the interrupt which led to calling intr_fast() (which is used with both
  fast and ithread interrupts) are blocked while in that function. Thus
  intr_fast() can be preempted by a fast interrupt (which are of a higher
  level than ithread interrupts) while servicing an ithread interrupt. This
  can lead to a stale pointer to the head of the active interrupt requests
  list when back in the ithread interrupt invocation of intr_fast(), in turn
  resulting in corruption of the interrupt request lists and consequently
  in a panic. Solve this be turning off interrupts in intr_fast() before
  reading the pointer to the head of the active list rather than after. [1]
- Add a KASSERT in intr_fast() which asserts that ir_func is non-zero before
  calling it. [1]
- Increment interrupt stats after calling the handlers rather than before.
  This reduces the delay until direct and fast handlers are serviced, in my
  testings by 30% on average for the direct tick interrupt handler, in turn
  resulting in less clock drift.

PR:		94778 [1]
Submitted by:	Andrew Belashov [1]
MFC after:	2 weeks
2006-04-17 21:03:24 +00:00
John Baldwin
efff0b01b6 Update comments to indicate that locks are held by threads, not processes. 2006-04-17 20:17:09 +00:00
John Baldwin
32553b153e Add a 'show sleepqueue' alias for 'show sleepq' in DDB. 2006-04-17 20:16:32 +00:00
John Baldwin
964b557211 Trim trailing whitespace. 2006-04-17 20:14:51 +00:00
John Baldwin
2971c36136 Add a new module_file() function that returns the linker_file_t associated
with a given module_t.  I use this in some the MOD_LOAD event handler for
some test kernel modules to ask the kernel linker to look up the linker
sets in my test modules. (I use linker sets to generate the list of
possible events that I then signal to execute via a sysctl.  On non-amd64,
ld(8) would resolve the entire linker set, but on amd64 I have to ask the
kernel linker to do it for me, and having the kernel linker do it works on
all archs.)
2006-04-17 19:44:44 +00:00
John Baldwin
0f180a7cce Change msleep() and tsleep() to not alter the calling thread's priority
if the specified priority is zero.  This avoids a race where the calling
thread could read a snapshot of it's current priority, then a different
thread could change the first thread's priority, then the original thread
would call sched_prio() inside msleep() undoing the change made by the
second thread.  I used a priority of zero as no thread that calls msleep()
or tsleep() should be specifying a priority of zero anyway.

The various places that passed 'curthread->td_priority' or some variant
as the priority now pass 0.
2006-04-17 18:20:38 +00:00
Søren Schmidt
305a0b7123 Add missing ";"
found by:	jmg
2006-04-17 10:47:01 +00:00
Maxim Konovalov
ae2772f800 o Do not double i/o stats for cd(4) already acounted in g_disk_done().
PR:		kern/95707
Submitted by:	Andre Albsmeier
Reviewed by:	phk
MFC after:	2 weeks
2006-04-17 09:12:53 +00:00
Ken Smith
39fac37953 Fix panic() message to give the right function name. 2006-04-17 07:43:56 +00:00
Warner Losh
ebcd52935b Add missing ~. We want all the INVALID bits to be 0... Let's see if this
helps people with their interrupt storm problem on card eject.
2006-04-16 23:16:45 +00:00
John-Mark Gurney
e98b5a89de remove duplicate sizeof vnode entry (debug.sizeof.vnode already existed)...
move ncsize into debug.sizeof and rename to namecache...
2006-04-16 18:38:30 +00:00
Sam Leffler
4a3ac3fc61 Improve ath_draintxq debug info: dump the packet as well
as the descriptor and handle the beacon q like other q's

MFC after:	1 month
2006-04-16 18:24:27 +00:00
Sam Leffler
2af90c547b Unbreak cabq handling: check the s/w q, not the h/w q as the frames
have not been passed to the h/w yet.  This remedies watchdog timeout
of buffered multicast frames in hostap mode.

While here eliminate an extraneous check; ieee80211_beacon_update sets
the tim bit based on ncabq != 0 so there's no reason to check it too.

Noticed by:	Christophe Prevotaux
2006-04-16 18:14:01 +00:00
Maxim Konovalov
a5e8745ad9 o Correct a path to include. 2006-04-16 15:35:12 +00:00
Scott Long
bb141be10a Take a better stab at making this compile. 2006-04-15 18:54:56 +00:00
Pawel Jakub Dawidek
cd0d707eb7 Correct debug: we are sending child bio here, not parent bio.
MFC after:	1 week
2006-04-15 18:30:42 +00:00
Scott Long
83bc5d54c8 Take a stab at making this compile. 2006-04-15 18:04:04 +00:00
Mitsuru IWASAKI
1b9518293e Oops, untested code was included accidentally.
Fixed.
2006-04-15 16:10:53 +00:00
Mitsuru IWASAKI
858a52f464 Import ACPI Dock Station support. Note that this is still very young.
Additional detach implementaions (or maybe improvement) for other
deivce drivers is required.

Reviewed by:	njl, imp
MFC after:	1 week
2006-04-15 12:31:34 +00:00
Maxim Konovalov
727e7d8621 o Fix printf(9) formatting: do not use hardcode "0x" and "#" flags
simultaneously.  Remove "#' flag to match a style of the rest of
file.

PR:		kern/85477
Submitted by:	Oliver Fromme
2006-04-15 11:41:40 +00:00
Maxim Konovalov
a09367f089 o s/PsuedoRAID/PseudoRAID/.
PR:		kern/94306
Submitted by:	Esa Karkkainen
2006-04-15 10:27:41 +00:00
Scott Long
f30cbfc63b Fix the interrupt handler to do the mandatory PCI flush before looking at
DMA memory.  The could contribute towards missed link state changes under
heavy bus load.
2006-04-15 08:13:06 +00:00
Robert Watson
086dafc15b Mirror IPv4 pcb locking into in6_setsockaddr() and in6_setpeeraddr():
acquire inpcb lock when reading inpcb port+address in order to prevent
races with other threads that may be changing them.

MFC after:	3 months
2006-04-15 05:24:23 +00:00
Warner Losh
78fd9f198c Fix style nit noticed by bde. 2006-04-15 02:51:53 +00:00
John Baldwin
76447e5618 Mark the thread pointer used during an adaptive spin volatile so that the
compiler doesn't decide to cache td_state.  Cachine the state would cause
the spinning thread to not notice when the owning thread stopped executing
(if it was preempted for example) which could result in livelock.
2006-04-14 19:51:50 +00:00
Matteo Riondato
1fe5a490ab Whitespace fix
Pointed out by: Nate Lawson
2006-04-14 17:26:04 +00:00
Søren Schmidt
3559734cee Dont poll for ATA_IDLE on a detached channel in suspend. 2006-04-14 16:25:42 +00:00
Doug Ambrisko
bc971e44ed Reduce the Linux ioctl range to what is needed. I didn't know what
I was doing when I first set the range up.
2006-04-14 16:13:28 +00:00
John Baldwin
a29b4f6eec Drop the kqueue global mutex as soon as we are finished with it rather
than keeping it locked until we exit the function to optimize the case
where the lock would be dropped and later reacquired.  The optimization
was broken when kevent's were moved from UFS to VFS and the knote list
lock for a vnode kevent became the lockmgr vnode lock.  If one tried
to use a kqueue that contained events for a kqueue fd followed by a vnode,
then the kq global lock would end up being held when the vnode lock was
acquired which could result in sleeping with a mutex held (and subsequent
panics) if the vnode lock was contested.

Reviewed by:	jmg
Tested by:	ps (on 6.x)
MFC after:	3 days
2006-04-14 14:27:28 +00:00
Matteo Riondato
c943ffcc29 Add device ID for Intel Pro/100 VE Network Connection card
PR:		kern/95729
Submitted by:	Nicky Bulthuis
MFC after:	1 day
2006-04-14 07:49:52 +00:00
David Xu
cfd6f8cd6c Clear TDF_SINTR in sleepq_resume_thread, also sleepq_catch_signal does
not need to clear it now, this should fix panic when msleep is recursivly
called. Patch is slightly adjusted after review.

Reviewed by: jhb
Tested by: Csaba Henk, csaba-ml at creo.hu
MFC after: 3 days
2006-04-13 23:29:25 +00:00
Martin Cracauer
3f4f4a1465 Make CCD be able to read and write Linux software raids.
Supported for raid-0 with <n> disks, raid-1 with 2 disks.

Manpages have examples, warnings etc.

Test scripts on
http://www.cons.org/cracauer/ccdconfig-linux/
Reviewed by:	alfred
2006-04-13 20:35:31 +00:00
Martin Cracauer
447be3f1e4 Repair ext2fs writes.
Strong candidate for backport to 6.x.

When allocating new blocks, the search for block group beginnings
would fail with a segfault.  There was a side-effect read access with
an off-by-one errors.  The results were not used in the error case so
the code worked in the past.  But now the FreeBSD kernel has tighter
mappings and the word accessed is not mapped (for me).

The Linux kernel has rewritten most of the allocation strategy by now.
Also, the Linux kernel cleaned up the integration of these files and
it look feasable to wrap the original Linux files in wrapper that
provides their favorite arguments instead of dragging around our own
code.
2006-04-13 19:37:32 +00:00
Warner Losh
e43d852f65 Add commented out define for TSC board's boot0. 2006-04-13 17:44:05 +00:00
Warner Losh
e439ab9afe MFp4:
For 32-bit SDRAM systems, enable D16 to D31 in the PIO controller.
Otherwise they read back as 0xffff.

Shave 8 bytes from the object size by using AT91C_BASE_PIOA directly
and by not assigning PIO_BSR to 0 in the DBGU init.  That's a nop in
two ways (everything defaults to peripheral A, and writing 0 changes
nothing).
2006-04-13 17:39:34 +00:00
Warner Losh
8015f1dbb8 Merge from p4:
Many places used #define FOO ((unsigned int) 0x23) where a simpler
#define FOO 0x23u would have sufficed.  This practice is overly
verbose and has the disadvantage that you can't say

	#if FOO == BAR
	#endif

because the extra "unsigned int" tokens choke cpp's little brain.
Migrate to the latter style to allow use in preprocessor statements.
The two are the same semantically anyway in a C context (at least for
the uses they are put to presently, C gurus can explain to me how they
differ).
2006-04-13 17:34:23 +00:00
Warner Losh
3de060b996 Need at91rm9200_lowlevel.h for SDRAM_BASE definition. 2006-04-13 17:31:02 +00:00
John Baldwin
9477358d00 Turn on ithread_destroy() and call it from intr_event_destroy() to tear
down an interrupt event's associated thread (if it has one).
2006-04-13 17:29:04 +00:00
Olivier Houchard
5d1e6e68fc Bring back arm-specific workaround from rev 1.15:
Do not use the IO-mapping to issue the reset on the 82546 on arm. For some
reason, it results in corrupted descriptors.
2006-04-13 15:10:25 +00:00
Olivier Houchard
eb66942114 We need to adjust the bus handle if the resource is SYS_RES_MEMORY, NOT
SYS_RES_IOPORT.
2006-04-13 15:07:59 +00:00
Olivier Houchard
b8986f5675 Disable/enable fiqs as well as irqs. 2006-04-13 14:25:28 +00:00
Ruslan Ermilov
28db813d07 Fix DEVICE_POLLING support (compile-only tested). 2006-04-13 14:12:26 +00:00
Ruslan Ermilov
3f0430b34f Re-apply changes to make this compile with -Wundef:
/usr/src/sys/modules/drm/radeon/../../../dev/drm/radeon_state.c:2976:5: "BITS_PER_LONG" is not defined

(Previous revision has trashed my changes.)
2006-04-13 11:16:59 +00:00
Alan Cox
ad740f9081 Include opt_pmap.h for PMAP_SHPGPERPROC.
PR: 94509
2006-04-13 03:31:48 +00:00
Warner Losh
6e8aee768a Common register definition for AT91RM9200 2006-04-12 21:23:36 +00:00
Warner Losh
e06ca69b2f Recovery boot loader for the AT91 family of processors. Download it
via xmodem to the DBGU port when the AT91 comes up in recovery mode.
The recovery loader will then load your program via xmodem into SDRAM
at 1MB which can do its things.  It needs to be tweaked to the
specific board one is using, but it fits in < 1kB (all of Atmel's ARM
products have at least 8kb of SRAM that I can tell, so this should
work for them all).

Parts of this code were provided by Kwikbyte with copyright
specifically disclaimed.  I heavily modified it to act as a recovery
loader (before it was a bootstrap loader) and to optimize for size
(before I started the size was closer to 8k).

Bootstrap loaders for SPI and IIC to follow.
2006-04-12 21:22:44 +00:00
Paul Saab
7b76202b5a Fix the PHY support for the 5780. I mis-merged this from my sources. 2006-04-12 18:34:00 +00:00
Pawel Jakub Dawidek
d3a1be900a Pass BIO_GETATTR requests down.
MFC after:	1 week
2006-04-12 12:18:44 +00:00
Pawel Jakub Dawidek
00a480ac5c Remove unused prototypes. 2006-04-12 12:17:29 +00:00
Pawel Jakub Dawidek
f3b67db31a On padlock initialization, allocate memory with M_WAITOK. 2006-04-12 12:13:34 +00:00
Pawel Jakub Dawidek
4a531e8dae Correct an obvious typo.
MFC after:	1 week
2006-04-12 12:12:44 +00:00
Robert Watson
e0cf89fc53 Use ANSI C function protypes and declarations for if_arcsubr.
MFC after:	1 month
2006-04-12 07:44:31 +00:00
Alan Cox
826c207263 Retire pmap_track_modified(). We no longer need it because we do not
create managed mappings within the clean submap.  To prevent regressions,
add assertions blocking the creation of managed mappings within the clean
submap.

Reviewed by: tegge
2006-04-12 04:22:52 +00:00
Robert Watson
8511b981f6 Assert the inpcb lock in udp6_output(), as we dereference various
fields.

MFC after:	3 months
2006-04-12 03:34:22 +00:00
Robert Watson
dec8026073 Add comment to udp6_input() that locking is missing from multicast
UDPv6 delivery.

Lock the inpcb of the UDP connection being delivered to before
processing IPSEC policy and other delivery activities.

MFC after:	3 months
2006-04-12 03:32:54 +00:00
Robert Watson
5383103aa0 Add udbinfo locking in udp6_input() to protect lookups of the inpcb
lists during UDPv6 receipt.

MFC after:	3 months
2006-04-12 03:23:56 +00:00
Robert Watson
ff7425ced0 Don't use spl around call to in_pcballoc() in IPv6 raw socket support;
all necessary synchronization appears present.

MFC after:	3 months
2006-04-12 03:07:22 +00:00
Robert Watson
41ba156433 Remove one remaining use of spl in the IPv6 fragmentation code, as
this code appears properly locked.

MFC after:	3 months
2006-04-12 03:06:20 +00:00
Robert Watson
e3beea90c7 Add missing locking to udp6_getcred(), remove spl use.
MFC after:	3 months
2006-04-12 03:03:47 +00:00
Robert Watson
4847772314 Remove spl use from IPv6 inpcb code.
In various inpcb methods for IPv6 sockets, don't check of so_pcb is NULL,
assert it isn't.

MFC after:	3 months
2006-04-12 02:52:14 +00:00
Olivier Houchard
1334cfe00c Make this compile without INVARIANTS. 2006-04-11 23:15:47 +00:00
Maxim Sobolev
e101181393 Merge in timeout into A20-enable routine from cdboot/boot1.
MFC after:	1 day
2006-04-11 20:53:49 +00:00
John Baldwin
31062da1b0 Drop the gateA20() function in the loader as it is unused. All the other
boot loaders that load the loader already handle A20.  In fact, they are
required to do so in order to setup the environment that btxldr expects.
2006-04-11 20:11:30 +00:00
John Baldwin
a115c84d58 Minor whitespace tweak. 2006-04-11 20:09:42 +00:00
Pawel Jakub Dawidek
71af8134f7 Be sure to wakeup the crypto thread when new request was queued.
This should fix a hang when starting cryptokeytest (and more).

MFC after:	1 month
2006-04-11 18:01:04 +00:00
John Baldwin
3793634041 Tweak comment. 2006-04-11 17:36:08 +00:00
John Baldwin
70e040dfcf Use the proper condition to determine that we matched an filename.
Otherwise, we could match on a filename that had the wrong last character
(such as /boot/loaded instead of /boot/loader).

PR:		kern/95625
Submitted by:	Oliver Fromme <olli@secnetix.de>
MFC after:	1 month
2006-04-11 17:26:54 +00:00
Matt Jacob
5089bd63bd A large set of changes:
+ Add boatloads of KASSERTs and *really* check out more locking
issues (to catch recursions when we actually go to real locking
in CAM soon). The KASSERTs also caught lots of other issues like
using commands that were put back on free lists, etc.

+ Target mode: role setting is derived directly from port capabilities.
There is no need to set a role any more. Some target mode resources
are allocated early on (ELS), but target command buffer allocation
is deferred until the first lun enable.

+ Fix some breakages I introduced with target mode in that some commands
are *repeating* commands. That is, the reply shows up but the command
isn't really done (we don't free it). We still need to take it off the
pending list because when we resubmit it, bad things then  happen.

+ Fix more of the way that timed out commands and bus reset is done. The
actual TMF response code was being ignored.

+ For SPI, honor BIOS settings. This doesn't quite fix the problems we've
seen where we can't seem to (re)negotiate U320 on all drives but avoids
it instead by letting us honor the BIOS settings. I'm sure this is not
quite right and will have to change again soon.
2006-04-11 16:47:30 +00:00
Florent Thoumie
e79417e5d4 - Add support for the Acer Acerscan 640BT.
- Add documentation bits.

PR:		usb/95616
Submitted by:	Matthieu Guegan <lesaint@gcu.info>
Approved by:	cperciva (mentor)
MFC after:	3 days
2006-04-11 10:44:31 +00:00
Maxim Sobolev
cd86367a5a When enabling A20 put upper limit on amount of time we wait for the keyboard
controller to get ready (65K x ISA access time, visually around 1 second).
If we have wait more than that amount it's likely that the hardware is a
legacy-free one and simply doesn't have keyboard controller and doesn't
require enabling A20 at all.

This makes cdboot working for MacBook Pro with Boot Camp.

MFC after:	1 day
2006-04-11 04:39:29 +00:00
Joseph Koshy
7c9f60e38f Fix a cut-n-paste bug that crept in.
Reported by:	"Pawel Worach" pawel.worach at gmail.com
2006-04-11 01:15:26 +00:00
Paul Saab
d8636a9ab7 Hook bce up to the build 2006-04-10 20:04:22 +00:00
Paul Saab
6caf734fd9 Add a driver for the Broadcom NetXtreme II (BCM5706/BCM5708)
PCI/PCIe Gigabit Ethernet adapeter.

Submitted by:	David Christensen
2006-04-10 19:55:23 +00:00
Pawel Jakub Dawidek
2c87962602 safe(4) doesn't support explicitly provided keys. Return an error instead
of encrypting/decrypting data with a wrong key.
2006-04-10 18:49:46 +00:00
Pawel Jakub Dawidek
483194fb9a ubsec(4) doesn't support explicitly provided keys. Return an error instead
of encrypting/decrypting data with a wrong key.
2006-04-10 18:37:46 +00:00
Pawel Jakub Dawidek
48b0f2e10f - Simplify the code by using arc4rand(9) instead of arc4random(9) in a loop.
- Correct a comment.

MFC after:	2 weeks
2006-04-10 18:24:59 +00:00
Pawel Jakub Dawidek
6131838b7c Hide net.inet.ipsec.test_{replay,integrity} sysctls under #ifdef REGRESSION.
Requested by:	sam, rwatson
2006-04-10 15:04:36 +00:00
SUZUKI Shinsuke
8447156ce0 ip6_mrouter_done(): use if_allmulti(0) for disabling the multicast promiscuous mode
Obtained from: KAME
MFC after: 2 days
2006-04-10 14:33:22 +00:00
Christian S.J. Peron
d5e5634075 Kill the last Giant acquisition in the exit(2) code. This Giant acquisition
doesn't appear to be protecting anything. Most of consumers funsetownlst(9)
do not appear to be picking up Giant anywhere. This was originally a part
of my Giant exit(2) clean up revision 1.272 but I thought it was a good idea
to leave it out until we were able to analyze it better.

Tested by:	kris
MFC after:	3 weeks
2006-04-10 14:07:28 +00:00
Pawel Jakub Dawidek
712fe9bd7a Introduce and use delayed-destruction functionality from a pre-sync hook,
which means that devices will be destroyed on last close.

This fixes destruction order problems when, eg. RAID3 array is build on
top of RAID1 arrays.

Requested, reviewed and tested by:	ru
MFC after:	2 weeks
2006-04-10 10:32:22 +00:00
Florent Thoumie
281f5eff33 - Add support for the Epson RX425 scanner.
PR:		usb/95346
Submitted by:	Matthieu Guegan <lesaint@gcu.info>
Approved by:	cperciva (mentor)
MFC after:	3 days
2006-04-10 10:21:09 +00:00
Pawel Jakub Dawidek
0909f38a3c On shutdown try to turn off all swap devices. This way GEOM providers are
properly closed on shutdown.

Requested by:	ru
Reviewed by:	alc
MFC after:	2 weeks
2006-04-10 10:03:41 +00:00
Scott Long
d21c5e5e18 Fix some small bugs.
Submitted by: pjd
Found by: Coverity Prevent (tm)
2006-04-10 06:44:30 +00:00
David Xu
e631cff309 Use proc lock to prevent a thread from exiting, Giant was no longer used to
protect thread list.
2006-04-10 04:55:59 +00:00
Marcel Moolenaar
ec0889a069 MFp4:
o  Implement the remove verb to remove a partition entry.
o  Improve error reporting by first checking that the verb is valid.
o  Add an entry parameter to the add verb. this parameter can be
   both read-only as welll as read-write and specifies the entry
   number of the newly added partition.
o  Make sure that the provider is alive when passed to us. It may
   be withering away.
o  When adding a new partition entry, test for overlaps with existing
   partitions.
2006-04-10 04:03:14 +00:00
Marcel Moolenaar
d99c155975 Add g_wither_provider() to abstract the details of destroying a
particular provider. Use this function where g_orphan_provider()
is being called so that the flags are updated correctly and
g_orphan_provider() is called only when allowed.
2006-04-10 03:55:13 +00:00
Olivier Houchard
123a5345c1 MFp4: Use CPU_CONTROL_ROUNDROBIN for arm9, it seems to give marginally
better performances.
2006-04-09 23:07:31 +00:00
Eric Anholt
72ab0eff0f Update to DRM CVS as of 2006-04-09. The most notable new feature is the updated
Radeon memmap code, which with a new DDX driver and DRI drivers should fix
long-term stability issues with Radeons.  Also adds support for r200's
ATI_fragment_shader, r300 texrect support and texture caching fixes, i915
vblank support and bugfixes, and new PCI IDs.
2006-04-09 20:45:45 +00:00
Olivier Houchard
43293c6937 Not only disable/enable interrupts, do it for FIQs as well, when needed. 2006-04-09 20:16:47 +00:00
Olivier Houchard
174329aff2 MFp4: Don't write-back the PTEs if they are mapped write-through, this was
apparently only needed because skyeye has bugs in its cache emulation.
2006-04-09 20:03:03 +00:00
Pawel Jakub Dawidek
dfa9422b4a Introduce two new sysctls:
net.inet.ipsec.test_replay - When set to 1, IPsec will send packets with
	the same sequence number. This allows to verify if the other side
	has proper replay attacks detection.

net.inet.ipsec.test_integrity - When set 1, IPsec will send packets with
	corrupted HMAC. This allows to verify if the other side properly
	detects modified packets.

I used the first one to discover that we don't have proper replay attacks
detection in ESP (in fast_ipsec(4)).
2006-04-09 19:11:45 +00:00
Pawel Jakub Dawidek
2320ec8b73 Be consistent with the rest of the code. 2006-04-09 19:00:23 +00:00
Robert Watson
b0f4fba749 In natm_usr_abort(), replace existing call to natm_usr_shutdown() with
natm_usr_detach(), which actually does the right thing.  This code has
never worked properly, but also was never invoked since we only abort
connections associated with listen sockets, and netnam doesn't support
listen sockets.

MFC after:	3 months
2006-04-09 17:14:09 +00:00
Robert Watson
3cbe7fafa5 Modify tcp_timewait() to accept an inpcb reference, not a tcptw
reference.  For now, we allow the possibility that the in_ppcb
pointer in the inpcb may be NULL if a timewait socket has had its
tcptw structure recycled.  This allows tcp_timewait() to
consistently unlock the inpcb.

Reported by:	Kazuaki Oda <kaakun at highway dot ne dot jp>
MFC after:	3 months
2006-04-09 16:59:19 +00:00
Robert Watson
c60afb3f55 Fix assertion description: !=, not ==.
Submitted by:	pjd
MFC after:	3 months
2006-04-09 16:33:41 +00:00
Robert Watson
d37b79a00f Remove UNIX domain socket raw socket support. This feature is documented
as being undocumented in Stevens, and was broken in 1997 during network
stack infrastructure work.  It is the one remaining (and incorrect)
direct protocol reference to raw_usrreq.pru_attach; this is incorrect
because the raw socket code assumes that raw_uattach is called only after
the protocol has allocated a PCB.

MFC after:	3 months
2006-04-09 16:29:47 +00:00
Philip Paeps
e13d42014a Add support for Asus W5A laptops.
Submitted by:	Pavel Martynenko <mpv -at- ip.net.ua>
X-MFC after:	3 days (or so)
2006-04-09 15:22:25 +00:00
Robert Watson
9d20951479 Correct an assertion in raw_uattach(): this is a library call that other
protocols invoke after allocating a PCB, so so_pcb should be non-NULL.
It is only used by the two IPSEC implementations, so I didn't hit it in
my testing.

Reported by:	pjd
MFC after:	3 months
2006-04-09 15:15:28 +00:00
Scott Long
93cfca2294 Rearrange locking in the alloc_commands and ioctl paths to avoid problems. 2006-04-08 06:05:29 +00:00
Scott Long
dce223cfb6 After further review and discussion, partially revert the previous commit.
The real problem was that ioctl handlers needed to call amr_wait_command()
with the list lock held.  This not only solves the completion race, it also
prevents bounce buffer corruption that could arise from amr_start() being
called without the proper locks held.

Discussed with: ps
MFC After: 3 days
2006-04-08 05:08:17 +00:00
Paul Saab
026d2aa333 Close a pesky race where after checking the BUSY flag in amr_wait_command,
the completion of the command can occur before tsleep is called and
the command ends up blocking forever since the wakeup has already
been called.

Submitted by:   ups
2006-04-08 02:23:27 +00:00
Marcel Moolenaar
07c8931358 Add the scc_hwmtx spin mutex, defined by scc(4). 2006-04-07 22:15:54 +00:00
Marcel Moolenaar
068bb61c55 Add kbdmux(4). This avoids having to use the hint.pcib.1.skipslot=26
trick on a PowerBook G4 and friends to get the USB keyboard as ukbd0.
2006-04-07 22:04:07 +00:00
John-Mark Gurney
1c4ca5e5fe spell unlock correctly, this is relatively minor as it's rare someone would
provide a lock method, and want the default unlock, but it is a bug...

PR:		95356
Submitted by:	Stephen Corteselli
MFC after:	3 days
2006-04-07 17:21:27 +00:00
Marcel Moolenaar
41063f9380 Change gctl_set_param() to return an error instead of setting an
error on the request.  Add a wrapper, gctl_set_param_err(), that
sets the error on the request from the error returned by
gctl_set_param() and update current callers of gctl_set_param()
to call gctl_set_param_err() instead.
This makes gctl_set_param() much more usable in situations where
the caller knows better what to do with certain (apparent) error
conditions and setting an error on the request is not one of the
things that need to be done.
2006-04-07 16:19:48 +00:00
Gleb Smirnoff
2a7d090a2e Restore accidentially removed rev. 1.3 2006-04-07 10:18:24 +00:00
Sam Leffler
587070382a backout rev 1.74
Requested by:	ssouhlal
2006-04-07 05:16:02 +00:00
Christian S.J. Peron
7935d5382b Introduce a new MAC entry point for label initialization of the NFS daemon's
credential: mac_associate_nfsd_label()

This entry point can be utilized by various Mandatory Access Control policies
so they can properly initialize the label of files which get created
as a result of an NFS operation. This work will be useful for fixing kernel
panics associated with accessing un-initialized or invalid vnode labels.

The implementation of these entry points will come shortly.

Obtained from:	TrustedBSD
Requested by:	mdodd
MFC after:	3 weeks
2006-04-06 23:33:11 +00:00
Olivier Houchard
602c85541e MFp4: Catchup with recent UART changes. 2006-04-06 20:47:54 +00:00
Mohan Srinivasan
1714e18e79 Eliminate debug code that catches bugs in the hinting of sack variables
(tcp_sack_output_debug checks cached hints aginst computed values by walking the
scoreboard and reports discrepancies). The sack hinting code has been stable for
many months now so it is time for the debug code to go. Leaving tcp_sack_output_debug
ifdef'ed out in case we need to resurrect it at a later point.
2006-04-06 17:21:16 +00:00
John Baldwin
0f2be07217 - Don't set CR0_NE and CR0_MP in npx_probe() as they are already set
earlier in cpu_setregs().
- If we know this CPU has a FPU via cpuid, then just assume the INT16
  interface and make the npx device quiet to not clutter the dmesg.  This
  is true for all Pentium and later CPUs and even some of the later 486dx
  CPUs.

Reviewed by:	bde
Tested by:	ps
MFC after:	1 week
2006-04-06 17:17:45 +00:00
Olivier Houchard
1ac232117c Add a new option, XSCALE_DISABLE_CCNT, to not use the xscale ccnt as a
timecounter (because gxemul doesn't emule it yet).
2006-04-06 17:11:08 +00:00
Gleb Smirnoff
a80d10932e Merge in new driver from Intel, version 5.1.5. Adds support for some
new chips and improves support for already supported ones.

Some details, important for future merges:
  - if_em.c merged manually, viewing diff between new vendor
    driver and previous one.
  - if_em_hw.h dropped in from vendor, and then restored revisions
    1.16, 1.17, 1.18.
  - if_em_hw.c dropped in from vendor, and then two liner change made,
    that restores support for two rare chips.
2006-04-06 17:09:03 +00:00
Suleiman Souhlal
90e72822ac Replace FILEDESC_[UN]LOCK_FAST() with a critical section on UP.
Gives a small but measurable performance improvement.

Submitted by:	Divacky Roman <xdivac02@stud.fit.vutbr.cz>
MFC after:	1 month
2006-04-06 16:27:48 +00:00
Warner Losh
5ec7256cb1 Add debug writes in error cases that, in theory, should never happen 2006-04-06 04:32:29 +00:00
Warner Losh
723c740a55 Connect twi to the FreeBSD iicbus infrastructure. 2006-04-06 04:31:19 +00:00
Warner Losh
222c969f16 Pull in numerous fixes from myself and cognet. With these fixes the
KB9202 eval board is finally stable with a nfs root.
2006-04-06 04:30:23 +00:00
Warner Losh
f535b19502 Remove unused bit definitions.
Minor style cleanup while I'm here.
2006-04-06 04:29:24 +00:00
Warner Losh
b2e16e9338 Optimize the TX side of the part by using the PDC to move bytes out to
the wire.  This increases the speed considerably.  Start to put
infrastructure in place to do RX side, but that requires more study
before it can be done.
2006-04-06 04:27:19 +00:00
Robert Watson
c0a1b804a7 Correct assertion in ng_detach().
Submitted by:	tegge
MFC after:	3 months
2006-04-06 02:54:42 +00:00
Mohan Srinivasan
5ef7d50da5 Keep track of the number of in-progress async direct IO writes in the nfsnode.
Make fsync/close wait until all of these drain. Add a check to nfs_getpage() and
nfs_putpage().
2006-04-06 01:20:30 +00:00
Pawel Jakub Dawidek
39d92f5fa3 Typos. 2006-04-05 22:07:31 +00:00
John Baldwin
907d4d7f45 Cache the value of the lower half of each I/O APIC redirection table entry
so that we only have to do an ioapic_write() instead of an ioapic_read()
followed by an ioapic_write() every time we mask and unmask level triggered
interrupts.  This cuts the execution time for these operations roughly in
half.

Profiled by:	Paolo Pisati <p.pisati@oltrelinux.com>
MFC after:	1 week
2006-04-05 20:43:19 +00:00
Robert Watson
a460ae4b4c Don't unlock a timewait structure if the pointer is NULL in
tcp_timewait().  This corrects a bug (or lack of fixing of a bug)
in tcp_input.c:1.295.

Submitted by:	Kazuaki Oda <kaakun at highway dot ne dot jp>
MFC after:	3 months
2006-04-05 08:45:59 +00:00
Mohan Srinivasan
1f65c2cd31 Certain (bad) values of sack blocks can end up corrupting the sack scoreboard.
Make the checks in tcp_sack_doack() more robust to prevent this.

Submitted by: Raja Mukerji (raja@mukerji.com)
Reviewed by:  Mohan Srinivasan
2006-04-05 00:11:04 +00:00
Warner Losh
dbafaeca13 newbus will zero softc, so no need to duplicate the zeroing here.
Plus a minor formatting nit in nearby code.
2006-04-04 23:29:17 +00:00