New file descriptor allocation code, derived from similar code introduced
in OpenBSD by Niels Provos. The patch introduces a bitmap of allocated
file descriptors which is used to locate available descriptors when a new
one is needed. It also moves the task of growing the file descriptor table
out of fdalloc(), reducing complexity in both fdalloc() and do_dup().
Debts of gratitude are owed to tjr@ (who provided the original patch on
which this work is based), grog@ (for the gdb(4) man page) and rwatson@
(for assistance with pxeboot(8)).
Atsushi Onoe [Thu, 15 Jan 2004 10:04:21 +0000 (10:04 +0000)]
Use generic net80211 framework for awi driver.
Restore awi to be workable again; it was broken..
XXX: The initialization is still unreliable yet, it sometimes fails on
some card.
Atsushi Onoe [Thu, 15 Jan 2004 08:44:27 +0000 (08:44 +0000)]
Add support for FH phy, which will be used by awi driver.
Also some if_media constants to indicate operational mode are changed
to bitmasks to reduce diffs from NetBSD.
Bill Paul [Thu, 15 Jan 2004 07:42:26 +0000 (07:42 +0000)]
Implement NdisCopyFromPacketToPacket() and NdisCopyFromPacketToPacketSafe().
I only have one driver that references this routine (for the 3Com 3cR990)
and it never gets called, but just in case, here it is.
Matthew N. Dodd [Thu, 15 Jan 2004 04:05:47 +0000 (04:05 +0000)]
- Add comments.
- Add more command defines and data structures.
- Re-organize struct ida_drive_info to factor out struct ida_drive_info
which will be used elsewhere.
Don Lewis [Wed, 14 Jan 2004 22:38:03 +0000 (22:38 +0000)]
VOP_GETATTR() wants the vnode passed to it to be locked. Instead
of adding the code to lock and unlock the vnodes and taking care
to avoid deadlock, simplify linux_emul_convpath() by comparing the
vnode pointers directly instead of comparing their va_fsid and
va_fileid attributes. This allows the removal of the calls to
VOP_GETATTR().
Søren Schmidt [Wed, 14 Jan 2004 21:26:35 +0000 (21:26 +0000)]
Use UMA instead of plain malloc for getting ATA request storage.
This gives +10% performance on simple tests, so definitly worth it.
A few percent more could be had by not using M_ZERO'd alloc's, but
we then need to clear fields all over the place to be safe, and
that was deemed not worth the trouble (and it makes life dangerous).
Nate Lawson [Wed, 14 Jan 2004 18:54:22 +0000 (18:54 +0000)]
When creating a package element via "Store(0xXXX, Index(ArgX, 0xXXX))",
be sure to increment the refcount of the argument so it is not
prematurely deleted. This is a workaround and may appear in a different
form in ACPI-CA. This fixes battery evaluation on Thinkpads that was
broken by fixing the Dell battery state.
#include <machine/cpufunc.h>, which may define inline versions of some
of the functions in libkern. Without this, parts of the kernel would
reference a non-existent (undeclared and undefined) ffs() function; the
only reason this didn't break the kernel build is that gcc happens to
have a built-in ffs() and incorrectly fails to warn about the lack of
prototypes for built-in functions.
Brian Feldman [Wed, 14 Jan 2004 00:39:28 +0000 (00:39 +0000)]
Add an "ethernet" hook to the rfc1490 netgraph module. It will send
and receive FCS-less RFC1490-"bridged" Ethernet packets that are
currently just ignored.
Don Lewis [Tue, 13 Jan 2004 22:55:46 +0000 (22:55 +0000)]
If a device attach routine fails during boot and calls bus_teardown_intr(),
ithread_remove_handler() may fail to remove the interrupt handler if
it decides to let the ithread do the removal. The problem is that during
boot "cold" is set, which causes msleep() to return immediately. This
will cause ithread_remove_handler() to fail to wait for the ithread
to do the removal from the handler TAILQ before freeing the handler
back to the heap. Bad things will happen when some other user of the
TAILQ, such as ithread_add_handler() or the actual ithread attempts to use
the freed handler. Fix the problem by forcing ithread_remove_handler()
to do the actual removal itself if the "cold" flag is set.
Brian Feldman [Tue, 13 Jan 2004 22:30:20 +0000 (22:30 +0000)]
Clarify revision 1.49. Specifically, using ${MAKE} target instead of
depending on a target will cause ${MAKE} to have been "reset" to
the initial value by make(1). This breaks, for example,
make MAKE="make -f subMakefile" clean. The supported way to pass
these sorts of make flags is actually the .MAKEFLAGS variable.
Alan Cox [Tue, 13 Jan 2004 20:36:03 +0000 (20:36 +0000)]
Use contigmalloc() and contigfree() instead of vm_page_alloc_contig() and
kmem_free(). Note: The FreeBSD-specific code in this file has been
subsumed by the FreeBSD-specific header file, pdq_freebsd.h. That header
file already specifies the use of contigmalloc() and contigfree(). Thus,
the purpose of this change is to avoid having nonsensical examples of
FreeBSD-specific memory allocation in our source tree.
David E. O'Brien [Tue, 13 Jan 2004 18:46:09 +0000 (18:46 +0000)]
* if-like-constructs now use <TAB>body consistently.
* Long statements with '\' continuation now use <4 spaces>continuation
consistently.
* wraps some long lines
* More consistent on how very simular repeated commands are wrapped.
Ruslan Ermilov [Tue, 13 Jan 2004 17:37:45 +0000 (17:37 +0000)]
Introduce DPSRCS, that holds the list of source files which are
needed for generating dependencies. SRCS are always part of it,
and normally only they.
This can be useful in some random cases where it's necessary to
have something in .depend that isn't part of SRCS. This will be
used to replace a hack in lib/libpam/libpam/Makefile.
Peter Grehan [Tue, 13 Jan 2004 11:24:36 +0000 (11:24 +0000)]
Make the OpenPic driver bus-independent, with attachments for
the MacIO chip and PSIM's IOBus. Bus-specific drivers should
use the identify method to attach themselves to nexus so
interrupt can be allocated before the h/w is probed. The
'early attach' routine in openpic is used for this stage
of boot. When h/w is probed, the openpic can be attached
properly. It will enable interrupts allocated prior to
this.
Peter Grehan [Tue, 13 Jan 2004 11:20:52 +0000 (11:20 +0000)]
Remove hard-coded knowledge of specific OFW devices. Use bus_generic_probe
and add_child entry point to allow devices to use the identify
method to add themselves if need be (e.g. openpic, syscons).
Export interrupt-controller-add routine for extern int cntlr drivers.
Eliminate recursive OFW device-tree walk and only iterate the
top-level ala sparc64. Allow child devices to set the device
type with write_ivars.
Step 1 of many in removing the hard-dependency on OpenFirmware.
Alan Cox [Tue, 13 Jan 2004 07:45:10 +0000 (07:45 +0000)]
Replace calls to vm_page_alloc_contig() by calls to contigmalloc().
vm_page_alloc_contig() will be removed after the three remaining drivers
that use it are also converted to contigmalloc().
Bill Paul [Tue, 13 Jan 2004 01:12:28 +0000 (01:12 +0000)]
Loosen up the range test in ndis_register_ioport(). Allow drivers to
map ranges that are smaller than what our resource manager code knows
is available, rather than requiring that they match exactly. This
fixes a problem with the Intel PRO/1000 gigE driver: it wants to map
a range of 32 I/O ports, even though some chips appear set up to
decode a range of 64. With this fix, it loads and runs correctly.
Bill Paul [Tue, 13 Jan 2004 00:29:17 +0000 (00:29 +0000)]
Yet another inf file handling tweak: when checking for Ndi\Params\foo
keys, don't just do a substring match on "Ndi\Params". Instead, check
explicitly for strings that begin with "Ndi\Params". Why? Because it's
possible to create your own keys with different paths, like
"PROSetNdi\NdiExt\Params" which is what Intel does in their PRO/1000
driver's .INF file.