Sam Leffler [Thu, 29 May 2008 00:10:48 +0000 (00:10 +0000)]
Cleanup power handling and fix suspend/resume:
o do not put the chip into full sleep in ath_stop as it gains
nothing and causes many parts to hang in ath_detach because we
may touch the chip during vap teardown; this may also fix issues
with unloading the module
o add a note in ath_detach to explain ath_hal_detach puts the
chip in low power mode; this is useful to know as it means
unloading the module will place a pci device in the lowest
possible power state
o leave an #ifdef notyet marker for powering down the chip when
a device is marked down; we can't do that until we handle all
the ways the driver may be entered and touch the chip
o fix resume by reloading the h/w key cache as it's been clobbered
(for pci) by the socket being powered off; for station mode we
directly stop+init the chip and then simulate a beacon miss to
get the upper layers sync'd up; for other configs we must brute
force stop+start the vaps so they go through the state machine
Sam Leffler [Wed, 28 May 2008 23:33:29 +0000 (23:33 +0000)]
Add ieee80211_crypto_reload_keys to push all keys known
to net80211 back into the device; intended for use on resume
by devices that lose the contents of their h/w key table.
Sam Leffler [Wed, 28 May 2008 23:32:00 +0000 (23:32 +0000)]
Add a mac address to the key definition as otherwise we lose the
address specified in the ioctl and for drivers that need the address
to locate a key (e.g. for delete).
Note this changes net80211-private api's but not the driver callback;
may want to change that in the future.
Doug Ambrisko [Wed, 28 May 2008 23:19:27 +0000 (23:19 +0000)]
Add support to talk to the LSI ioctl path on with FreeBSD 32 bit app's
on amd64. Note the only difference is the iovec32 part so I use the
native structure for everything else.
Also I plan to MFC all the changes in -current to 7-stable and 6-stable
shortly since I've been running them. This does not include the cam
changes.
Sam Leffler [Wed, 28 May 2008 23:10:53 +0000 (23:10 +0000)]
Revise lock name handling:
o construct a name for the com lock as done for other locks
o pass the device name to IEEE80211_LOCK_INIT so the mtx name
is constructed as foo_com_lock
o introduce *_LOCK_OBJ macro's to hide the lock contents and
minimize redundant code
Fix checking if a variable name is LINENO. As STPUTC changes the pointer if it
needs to enlarge the buffer, we must not keep a pointer to the beginning.
Ed Schouten [Wed, 28 May 2008 20:25:19 +0000 (20:25 +0000)]
Remove redundant checks from fcntl()'s F_DUPFD.
Right now we perform some of the checks inside the fcntl()'s F_DUPFD
operation twice. We first validate the `fd' argument. When finished,
we validate the `arg' argument. These checks are also performed inside
do_dup().
The reason we need to do this, is because fcntl() should return different
errno's when the `arg' argument is out of bounds (EINVAL instead of
EBADF). To prevent the redundant locking of the PROC_LOCK and
FILEDESC_SLOCK, patch do_dup() to support the error semantics required
by fcntl().
Marcel Moolenaar [Wed, 28 May 2008 16:41:02 +0000 (16:41 +0000)]
Work-around a compiler optimization bug, that broke libthr. Massive
inlining resulted in constant propagation to the extend that cmpval
was known to the compiler to be URWLOCK_WRITE_OWNER (= 0x80000000U).
Unfortunately, instead of zero-extending the unsigned constant, it
was sign-extended. As such, the cmpxchg instruction was comparing
0x0000000080000000LU to 0xffffffff80000000LU and obviously didn't
perform the exchange.
But, since the value returned by cmpxhg equalled cmpval (when zero-
extended), the _thr_rtld_lock_release() function thought the exchange
did happen and as such returned as if having released the lock. This
was not the case. Subsequent locking requests found rw_state non-zero
and the thread in question entered the kernel and block indefinitely.
The work-around is to zero-extend by casting to uint64_t.
Bjoern A. Zeeb [Tue, 27 May 2008 21:05:49 +0000 (21:05 +0000)]
To both the (formerly) 'temporarily disconnected' netatm and I4B modules
add a comment "(removed 20080525)" to make clear that it is no longer
temporary.
Antoine Brodin [Tue, 27 May 2008 19:04:31 +0000 (19:04 +0000)]
- Increase the size of the salt in pw(8) from 8 to 32 (same as in pam_unix(8)).
This makes blowfish password hashes look normal when set using
pw(8)/adduser(8). [1]
- Make it possible to have a '/' in the salt.
Maksim Yevmenkin [Tue, 27 May 2008 17:46:32 +0000 (17:46 +0000)]
Bluetooth SIG is being difficult and keep moving specification
documents away from being public accessible. Replace link to
the Bluetooth specification document with the document name.
Pointed out by: SoftLover < slserg at uic dot tula dot ru >
MFC after: 3 days
Plug a memory leak which can occur when multiple MAC policies are loaded
which label mbufs. This leak can occur if one policy successfully allocates
label storage and subsequent allocations from other policies fail.
Ed Schouten [Tue, 27 May 2008 06:41:50 +0000 (06:41 +0000)]
Rename `tty_subr.c' to `subr_clist.c'.
Because clists are also used outside the TTY layer, rename the file
containing the clist routines to something more accurate.
The mpsafetty TTY layer doesn't use clists. It uses its own buffers,
which also implement the unbuffered copying to userspace. We cannot
simply remove the clist routines then, because this would break various
drivers that are present within the kernel.
Add a -n option to pkg_create(1), to inhibit duplicate work.
When run without this option, multiple runs of `pkg_create -Rb' will
recreate common packages multiple times. This can take a lot of time
for large packages. With the -n option `pkg_create -b' checks with
stat(2) and skips packages that already exist.
Note that this may *not* be safe of the existing output file is not
really a package, or if it has been corrupted, modified or otherwise
tinkered with between subsequent pkg_create runs. For this and POLA
reasons, the default behavior is to *rebuild* the packages, and the -n
option can be used when we know it is `safe' to run in no-regenerate
mode.
Inspired by: A post to freebsd-questions
by Matthias Apitz < matthias.apitz at oclc.org >
Reviewed by: marcus, flz
Approved by: marcus
MFC after: 2 weeks
Tim Kientzle [Tue, 27 May 2008 04:12:17 +0000 (04:12 +0000)]
Until the old archive.h.in gets renamed to archive.h in the repository,
we still need some Makefile trickery to ensure archive.h is
correctly built for the test harness.
Ariff Abdullah [Tue, 27 May 2008 02:16:05 +0000 (02:16 +0000)]
Release pcm mutex before calling snd_clone_unref(), which in turns might
calling destroy_dev() with sleepable malloc(9). The entire opetation
is being serialized through pcm cv from top down, so dropping mutex is
rather safe.
Pyun YongHyeon [Tue, 27 May 2008 01:42:01 +0000 (01:42 +0000)]
Add driver support for PCIe adapters based on JMicron JMC250
gigabit ethernet and JMC260 fast ethernet controllers. ATM jme(4)
supports all hardware features except RSS and multiple Tx/Rx queue.
In these days most ethernet controller vendors take a ply of
concealing hardware detailes from open source developers. As
contrasted with these vendors JMicron provided all necessary
information needed to write a stable driver during driver writing
and answered many questions I had. They even helped fixing driver
bugs with protocol analyzer. Many thanks to JMicron for their
support of FreeBSD.
Attilio Rao [Tue, 27 May 2008 00:20:19 +0000 (00:20 +0000)]
Once the ENOLCK is detected we expect to retry the acquisition.
Anyway, in the edge case the flushing happens and the while is no more
executed, nfs_flush() (and nfs4_flush()) can return with a wrong
err value of ENOLCK.
Bring it back to 0, as we expect to have for that case.
Tim Kientzle [Mon, 26 May 2008 19:19:58 +0000 (19:19 +0000)]
Connect bsdcpio up to the build.
Starting now, there are two cpio programs in the base system:
/usr/bin/gcpio - GNU cpio
/usr/bin/bsdcpio - bsdcpio
In addition, there is a symlink:
/usr/bin/cpio -> /usr/bin/gcpio (default)
/usr/bin/cpio -> /usr/bin/bsdcpio (WITH_BSDCPIO)
In particular, WITH_BSDCPIO only controls the
symlink; bsdcpio is always built regardless.
Unless there are objections or problems, I intend:
* to make /usr/bin/bsdcpio available in 7.1
* to have /usr/bin/cpio default to bsdcpio in 8.0
(WITH_GCPIO will be an option instead of WITH_BSDCPIO)
* to leave /usr/bin/gcpio in the tree until 9.0
Tim Kientzle [Mon, 26 May 2008 17:15:35 +0000 (17:15 +0000)]
Initial commit of bsdcpio 0.9.11b.
A new implementation of cpio that uses libarchive as it's back-end
archiving/dearchiving infrastructure. Includes test harness;
"make check" in the bsdcpio directory to build and run the test
harness.
Tim Kientzle [Mon, 26 May 2008 17:10:10 +0000 (17:10 +0000)]
MFp4: bsdtar 2.5.4b
In addition to a number of bug fixes and minor changes:
* --numeric-owner (ignore user/group names on create and extract)
* -S (sparsify files on extraction)
* -s (regex filename substitutions)
* Use new libarchive 'linkify' to get correct hardlink handling for
both old and new cpio formats
* Rework 'copy' test to be insensitive to readdir() filename ordering
Most of the credit for this work goes to Joerg Sonnenberger, who
has been duplicating features from NetBSD's 'pax' program.
Tim Kientzle [Mon, 26 May 2008 17:00:24 +0000 (17:00 +0000)]
MFp4: libarchive 2.5.4b. (Still 'b' until I get a bit more
feedback, but the 2.5 branch is shaping up nicely.)
In addition to many small bug fixes and code improvements:
* Another iteration of versioning; I think I've got it right now.
* Portability: A lot of progress on Windows support (though I'm
not committing all of the Windows support files to FreeBSD CVS)
* Explicit tracking of MBS, WCS, and UTF-8 versions of strings
in archive_entry; the archive_entry routines now correctly return
NULL only when something is unset, setting NULL properly clears
string values. Most charset conversions have been pushed down to
archive_string.
* Better handling of charset conversion failure when writing or
reading UTF-8 headers in pax archives
* archive_entry_linkify() provides multiple strategies for
hardlink matching to suit different format expectations
* More accurate bzip2 format detection
* Joerg Sonnenberger's extensive improvements to mtree support
* Rough support for self-extracting ZIP archives. Not an ideal
approach, but it works for the archives I've tried.
* New "sparsify" option in archive_write_disk converts blocks of nulls
into seeks.
* Better default behavior for the test harness; it now reports
all failures by default instead of coredumping at the first one.
Use _WANT_FILE to make struct file visible from userland. This is
similar to _WANT_UCRED and _WANT_PRISON and seems to be much nicer than
defining _KERNEL.
It is also needed for my sys/refcount.h change going in soon.
Bjoern A. Zeeb [Mon, 26 May 2008 10:40:09 +0000 (10:40 +0000)]
Remove ISDN4BSD (I4B) from HEAD as it is not MPSAFE and
parts relied on the now removed NET_NEEDS_GIANT.
Most of I4B has been disconnected from the build
since July 2007 in HEAD/RELENG_7.
This is what was removed:
- configuration in /etc/isdn
- examples
- man pages
- kernel configuration
- sys/i4b (drivers, layers, include files)
- user space tools
- i4b support from ppp
- further documentation
Xin LI [Mon, 26 May 2008 07:40:14 +0000 (07:40 +0000)]
We can not call iwn_start directly in the interrupt
context, where the iwn mutex is being held, and
iwn_start assumes that we do not have that mutex held.
Resolve this issue with what we do for other NICs by
splitting the iwn_start procedure into two parts,
iwn_start() do the locking, and iwn_start_locked()
assumes that the mutex is being held. This resolves
panic when WITNESS is enabled.
Robert Watson [Sun, 25 May 2008 22:11:40 +0000 (22:11 +0000)]
Remove netatm from HEAD as it is not MPSAFE and relies on the now removed
NET_NEEDS_GIANT. netatm has been disconnected from the build for ten
months in HEAD/RELENG_7. Specifics:
- netatm include files
- netatm command line management tools
- libatm
- ATM parts in rescue and sysinstall
- sample configuration files and documents
- kernel support as a module or in NOTES
- netgraph wrapper nodes for netatm
- ctags data for netatm.
- netatm-specific device drivers.
John Birrell [Sun, 25 May 2008 20:24:07 +0000 (20:24 +0000)]
Comment out the code that breaks with invariants. This is stuff that is
still WIP along with the lockstat provider, so there is no harm leaving
it out for now.
Attilio Rao [Sun, 25 May 2008 14:57:43 +0000 (14:57 +0000)]
Replace direct atomic operation for the file refcount witht the
refcount interface.
It also introduces the correct usage of memory barriers, as sometimes
fdrop() and fhold() are used with shared locks, which don't use any
release barrier.
John Birrell [Sun, 25 May 2008 02:48:57 +0000 (02:48 +0000)]
Remove sun4v from the list of arches in 'make universe'. There has been
no active development on it for over a year now and it isn't
reliable under a simple buildworld. Developers can't be expected to
test code targeted for it.
Alan Cox [Sat, 24 May 2008 21:57:16 +0000 (21:57 +0000)]
To date, our implementation of munmap(2) has required that the
entirety of the specified range be mapped. Specifically, it has
returned EINVAL if the entire range is not mapped. There is not,
however, any basis for this in either SuSv2 or our own man page.
Moreover, neither Linux nor Solaris impose this requirement. This
revision removes this requirement.
Bjoern A. Zeeb [Sat, 24 May 2008 19:29:02 +0000 (19:29 +0000)]
Restore buildable state. Style ignored.
Leave IDTVEC(ill) where it was unless we compile with KDTRACE_HOOKS[1].
Hide the with DTRACE case case under #ifdef KDTRACE_HOOKS.
Bjoern A. Zeeb [Sat, 24 May 2008 15:20:48 +0000 (15:20 +0000)]
Factor out the v4-only vs. the v6-only inp_flags processing in
ip6_savecontrol in preparation for udp_append() to no longer
need an WLOCK as we will no longer be modifying socket options.
Requested by: rwatson
Reviewed by: gnn
MFC after: 10 days