]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
15 years ago- Always force AHCI mode on a ATI/AMD SB600/700/800 SATA controller. These
Jung-uk Kim [Mon, 27 Apr 2009 17:29:51 +0000 (17:29 +0000)]
- Always force AHCI mode on a ATI/AMD SB600/700/800 SATA controller.  These
controllers may be configured as legacy IDE mode by modifying subclass and
progif without actually changing PCI device IDs.  Instead of complicating
code, we always force AHCI mode while probing.  Also we restore AHCI mode
while resuming per ATI/AMD register programming/requirement guides.
- Fix SB700/800 "combined" mode.  Unlike SB600, this PATA controller can
combine two SATA ports and emulate one PATA channel as primary or secondary
depending on BIOS configuration.  When the combined mode is disabled, this
channel disappears and it works just like SB600 PATA controller, however.
- Add more PCI device IDs for SB700/800 and adjust device descriptions.
SB800 shares the same PCI device IDs and added two more SATA IDs.

15 years agoFix build: Make forgotten IFNET_MULTIQUEUE to IFNET_BUF_RING
Andrew Gallatin [Mon, 27 Apr 2009 17:24:47 +0000 (17:24 +0000)]
Fix build:  Make forgotten IFNET_MULTIQUEUE to IFNET_BUF_RING
ifdef change.

15 years agoThanks for Michael Tuexen for tracking down a path where
Jack F Vogel [Mon, 27 Apr 2009 17:22:14 +0000 (17:22 +0000)]
Thanks for Michael Tuexen for tracking down a path where
the watchdog timer was not being rearmed in txeof, and also
a missing case in the new code.

MFC after: 2 weeks

15 years agofix various build errors (missing or wrong return types for
Luigi Rizzo [Mon, 27 Apr 2009 16:57:19 +0000 (16:57 +0000)]
fix various build errors (missing or wrong return types for
various functions returning void, missing headers, and so on).

MFC after: 4 weeks (not before 7.3 is out, anyways)

15 years ago Change the semantics of i_modrev/va_filerev to what is required for
Rick Macklem [Mon, 27 Apr 2009 16:46:16 +0000 (16:46 +0000)]
  Change the semantics of i_modrev/va_filerev to what is required for
  the nfsv4 Change attribute. There are 2 changes:
  1 - The value now changes on metadata changes as well as data
      modifications (incremented for IN_CHANGE instead of IN_UPDATE).
  2 - It is now saved in spare space in the on-disk i-node so that it
      survives a crash.
  Since va_filerev is not passed out into user space, the only current
  use of va_filerev is in the nfs server, which uses it as the directory
  cookie verifier. Since this verifier is only passed back to the server
  by a client verbatim and then the server doesn't check it, changing the
  semantics should not break anything currently in FreeBSD.

Reviewed by: bde
Approved by: kib (mentor)

15 years agoStart to convert this over to the new tty layer. These changes allow
Doug Ambrisko [Mon, 27 Apr 2009 15:58:38 +0000 (15:58 +0000)]
Start to convert this over to the new tty layer.  These changes allow
this driver to compile and limp along with the new layer.  These changes
do not deal with proper locking around access to the HW.  This is only
a starting point.  I have not tested modem control but tip seems to work
okay and I can send and receive characters which I needed for one of my
-current boxes.  I have not tied this driver back up to the build since
I don't want people to think it is ready for prime time.  If anyone
else has some cycles to work on this feel free to!

Also add support for a 16 port PCI interface I have at work.

Glanced at by: ed

15 years agoUpdates to mxge for multiple tx/rx rings:
Andrew Gallatin [Mon, 27 Apr 2009 15:45:54 +0000 (15:45 +0000)]
Updates to mxge for multiple tx/rx rings:

- Update mxge to use if_transmit(), and the new buf_ring
  interfaces, so as to enable multiple transmit queues.
  Use of if_transmit() is conditional on IFNET_BUF_RING,
  and is enabled by default (as in if_em).

- Record a flow id on receive if receive hashing is active.
  I currently only record the rx ring id (0..8) rather than
  the 32-bit topelitz hash result, as doing the latter would
  require shifting the driver to use a larger rx return ring.

Sponsored by:  Myricom, Inc.

15 years agoadd IEEE80211_FEXT_4ADDR to indicate ieee80211_encap should do 4-address
Sam Leffler [Sun, 26 Apr 2009 23:11:22 +0000 (23:11 +0000)]
add IEEE80211_FEXT_4ADDR to indicate ieee80211_encap should do 4-address
encapsulation when relaying frames; this reduces the cost of the test and
enables use for situations other than "sta vap + dwds"

15 years agodon't depend on includes to get definitions of struct ieee80211_tx_ampdu
Sam Leffler [Sun, 26 Apr 2009 23:04:35 +0000 (23:04 +0000)]
don't depend on includes to get definitions of struct ieee80211_tx_ampdu
and ieee80211_rx_ampdu; these should've been part of r191552

15 years agohoist ampdu tx aggregation setup from ieee80211_encap to ieee80211_start
Sam Leffler [Sun, 26 Apr 2009 23:02:17 +0000 (23:02 +0000)]
hoist ampdu tx aggregation setup from ieee80211_encap to ieee80211_start
where it was meant all along (the code was in encap because ampdu was
implemented pre vaps)

15 years agoallow drivers to hook ampdu rx start/stop
Sam Leffler [Sun, 26 Apr 2009 22:54:51 +0000 (22:54 +0000)]
allow drivers to hook ampdu rx start/stop

15 years agoimprovements:
Sam Leffler [Sun, 26 Apr 2009 22:49:25 +0000 (22:49 +0000)]
improvements:
o formatting
o more rx ampdu state
o tdma state
o show ifnet names
o show auth policy name

15 years agostash the node pointer in the mbuf before doing ff aggregration so this
Sam Leffler [Sun, 26 Apr 2009 22:45:21 +0000 (22:45 +0000)]
stash the node pointer in the mbuf before doing ff aggregration so this
is done in only one place

15 years agowhitespace
Sam Leffler [Sun, 26 Apr 2009 22:44:23 +0000 (22:44 +0000)]
whitespace

15 years agoIn preparation for turning on options VIMAGE in next commits,
Marko Zec [Sun, 26 Apr 2009 22:06:42 +0000 (22:06 +0000)]
In preparation for turning on options VIMAGE in next commits,
rearrange / replace / adjust several INIT_VNET_* initializer
macros, all of which currently resolve to whitespace.

Reviewed by: bz (an older version of the patch)
Approved by: julian (mentor)

15 years agoprint both fc bytes when hitting a protocol version mismatch
Sam Leffler [Sun, 26 Apr 2009 21:50:21 +0000 (21:50 +0000)]
print both fc bytes when hitting a protocol version mismatch

15 years agoadd iv_recv_ctl method to allow hooking rx ctl frame handling
Sam Leffler [Sun, 26 Apr 2009 21:46:04 +0000 (21:46 +0000)]
add iv_recv_ctl method to allow hooking rx ctl frame handling

15 years agodon't fragment ampdu aggregates
Sam Leffler [Sun, 26 Apr 2009 21:37:02 +0000 (21:37 +0000)]
don't fragment ampdu aggregates

15 years agouniformly mark mbufs that pass through the tx path with M_MCAST; drivers
Sam Leffler [Sun, 26 Apr 2009 21:34:53 +0000 (21:34 +0000)]
uniformly mark mbufs that pass through the tx path with M_MCAST; drivers
can now use this flag instead of inspecting the contents

15 years agoEliminate an errant comment.
Alan Cox [Sun, 26 Apr 2009 21:24:50 +0000 (21:24 +0000)]
Eliminate an errant comment.

Discussed with: tegge

15 years agoo add missing 802.3 bpf tap
Sam Leffler [Sun, 26 Apr 2009 21:21:48 +0000 (21:21 +0000)]
o add missing 802.3 bpf tap
o add 802.11 bpf tap to output path now that it's removed from ieee80211_encap

15 years agoadd missing DLT_IEEE802_11 tap
Sam Leffler [Sun, 26 Apr 2009 21:21:07 +0000 (21:21 +0000)]
add missing DLT_IEEE802_11 tap

15 years agoadd missing part of r191537 that should have read: hoist DLT_IEEE802_11
Sam Leffler [Sun, 26 Apr 2009 21:16:29 +0000 (21:16 +0000)]
add missing part of r191537 that should have read: hoist DLT_IEEE802_11
bpf tap from ieee80211_encap up to ieee80211_start

15 years agoImprove approximation of style(9).
Robert Watson [Sun, 26 Apr 2009 21:16:03 +0000 (21:16 +0000)]
Improve approximation of style(9).

15 years agofix comment
Sam Leffler [Sun, 26 Apr 2009 21:13:18 +0000 (21:13 +0000)]
fix comment

15 years agoadd missing DLT_IEEE802_11 bpf tap in ieee80211_start
Sam Leffler [Sun, 26 Apr 2009 21:12:19 +0000 (21:12 +0000)]
add missing DLT_IEEE802_11 bpf tap in ieee80211_start

15 years agofixup ieee80211_output handling:
Sam Leffler [Sun, 26 Apr 2009 21:11:12 +0000 (21:11 +0000)]
fixup ieee80211_output handling:
o correct bpf handling, send 'em to the right tap
o do accouting
o mark mbufs holding multicast frames

15 years agoRemove the unused insque() and remque() functions.
Ed Schouten [Sun, 26 Apr 2009 21:06:11 +0000 (21:06 +0000)]
Remove the unused insque() and remque() functions.

We have no code in the tree that uses these anymore. New code should
just use the regular queue(3) macros.

15 years agoo use shared code to handle bpf tap and mbuf cleanup
Sam Leffler [Sun, 26 Apr 2009 21:03:29 +0000 (21:03 +0000)]
o use shared code to handle bpf tap and mbuf cleanup
o swap conditional order to put the cheapest first

15 years agoMake the SPX code use its own copies of insque()/remque().
Ed Schouten [Sun, 26 Apr 2009 21:03:27 +0000 (21:03 +0000)]
Make the SPX code use its own copies of insque()/remque().

Instead of using the antique insque()/remque() functions from
sys/queue.h, make this code use its own versions. Eventually the code
should just use the regular TAILQ/LIST macros.

15 years agocorrect bssid reporting for wds vaps
Sam Leffler [Sun, 26 Apr 2009 20:55:31 +0000 (20:55 +0000)]
correct bssid reporting for wds vaps

15 years agoEliminate an archaic band-aid. The immediately preceding comment already
Alan Cox [Sun, 26 Apr 2009 20:54:57 +0000 (20:54 +0000)]
Eliminate an archaic band-aid.  The immediately preceding comment already
explains why the band-aid is unnecessary.

Suggested by: tegge

15 years agoWhitespace (use tabs like for all other lines).
Bjoern A. Zeeb [Sun, 26 Apr 2009 19:15:19 +0000 (19:15 +0000)]
Whitespace (use tabs like for all other lines).

MFC after:  1 month

15 years agoAcquire IF_ADDR_LOCK() around most iterations over ifp->if_addrhead
Robert Watson [Sun, 26 Apr 2009 19:05:40 +0000 (19:05 +0000)]
Acquire IF_ADDR_LOCK() around most iterations over ifp->if_addrhead
(colloquially known as if_addrlist).  Currently not acquired around
interface address loops that call out to the routing code due to
potential lock order issues.

MFC after: 3 weeks

15 years agoReading an mtree file is supposed to provide
Tim Kientzle [Sun, 26 Apr 2009 18:57:50 +0000 (18:57 +0000)]
Reading an mtree file is supposed to provide
access to the file data (if the file exists on
disk).  This was broken for the first regular
file; fix it and add a test so it won't break again.

In particular, this fixes the following idiom for creating
a tar archive in which every file is owned by root:

tar cf - --format=mtree .  \
    | sed -e 's/uname=[a-z]*/uname=root/' -e 's/uid=[0-9]*/uid=0/' \
    | tar cf - @-

15 years agoVarious improvements to the tar.5 manpage, including
Tim Kientzle [Sun, 26 Apr 2009 18:46:40 +0000 (18:46 +0000)]
Various improvements to the tar.5 manpage, including
descriptions of the GNU tar "posix-style" sparse format,
clarification of the Solaris tar ACL storage,
and a few comments about Mac OS X tar's resource storage.

15 years agoExit with ARCHIVE_FATAL if the ISO image is truncated.
Tim Kientzle [Sun, 26 Apr 2009 18:43:49 +0000 (18:43 +0000)]
Exit with ARCHIVE_FATAL if the ISO image is truncated.

15 years agoRemove an unused variable.
Tim Kientzle [Sun, 26 Apr 2009 18:24:14 +0000 (18:24 +0000)]
Remove an unused variable.

Thanks to: Christoph Mallon

15 years agoFix typo.
Edward Tomasz Napierala [Sun, 26 Apr 2009 10:12:20 +0000 (10:12 +0000)]
Fix typo.

15 years agoRemove even more empty directories.
Ed Schouten [Sun, 26 Apr 2009 09:36:55 +0000 (09:36 +0000)]
Remove even more empty directories.

I just used `hidesvn find . -type d -empty' to figure out which
directories are empty. This means I couldn't easily figure out which
directories only contained empty subdirectories.

15 years agoRemove empty directories from the HEAD.
Ed Schouten [Sun, 26 Apr 2009 09:31:58 +0000 (09:31 +0000)]
Remove empty directories from the HEAD.

Discussed with: developers, imp

15 years agoRemove unneeded device index from unit number.
Ed Schouten [Sun, 26 Apr 2009 09:21:37 +0000 (09:21 +0000)]
Remove unneeded device index from unit number.

We only use the unit number to determine whether we should rewind the
device upon closure.

15 years agoBump copyright year;
Marc Fonvieille [Sun, 26 Apr 2009 07:16:01 +0000 (07:16 +0000)]
Bump copyright year;
Add missing colon and fix broken entity.

15 years agoIn preparation to make options VIMAGE operational, where needed,
Marko Zec [Sun, 26 Apr 2009 07:14:50 +0000 (07:14 +0000)]
In preparation to make options VIMAGE operational, where needed,
initialize / release netgraph related state in iattach() / idetach()
functions called via the vnet module registration / initialization
framework, instead of initialization / cleanups being done in
mod_event handlers.

While here, introduce a crude hack aimed at preventing ng_ether to
autoattach to ng_eiface ifnets, which are also netgraph nodes already.

Reviewed by: bz
Approved by: julian (mentor)

15 years agoUnbreak the build of relnotes.
Marc Fonvieille [Sun, 26 Apr 2009 07:12:04 +0000 (07:12 +0000)]
Unbreak the build of relnotes.

15 years agoExtend the vnet module registration / initialization framework
Marko Zec [Sun, 26 Apr 2009 07:09:39 +0000 (07:09 +0000)]
Extend the vnet module registration / initialization framework
first introduced @ r190909 with a vnet module deregistration
service.

kldunloadable modules, which are currently using vnet_mod_register()
to attach their per-vnet initialization routines to the vnet
initialization framework, should call vnet_mod_deregister() before
acknowledging MOD_UNLOAD requests in their mod_event handlers.  Such
changes to the existing code base will follow in subsequent commits.

vnet_mod_deregister() does not check whether departing vnet modules
are registered as prerequisites for another module(s), so it should
be used with care.  Currently I'm only aware of vnet modules which
are leafs on module dependency graphs that are kldunloadable.

This change also introduces per-vnet module destructor handler, which
calls vnet's module cleanup function, which (if required) has to be
registered in vnet module's vnet_modinfo_t structure .vmi_idetach
field.  Once options VIMAGE becomes operational, the framework will
take care that module's cleanup function become invoked for each
active vnet instance, and that the memory allocated for each instance
gets freed.  Currently calls to destructor handlers must always
succeed.

15 years agoExpand coverage of IF_ADDR_LOCK() in in_control() from point of initial
Robert Watson [Sat, 25 Apr 2009 23:02:57 +0000 (23:02 +0000)]
Expand coverage of IF_ADDR_LOCK() in in_control() from point of initial
lookup of 'ia' from if_addrhead through most use.  Note that we
currently have to drop it prematurely in some cases due to calls out to
the routing and interface code while using 'ia', but this closes many
races.  Annotate several potential races that persist after this change.
Move to using M_NOWAIT for allocating new interface addresses due to
lock(s) being held.

MFC after: 3 weeks

15 years agoMake the state string descriptions public.
Andrew Thompson [Sat, 25 Apr 2009 21:25:52 +0000 (21:25 +0000)]
Make the state string descriptions public.

15 years agoTrack the usb device state as its powered on, addressed and configured. This helps
Andrew Thompson [Sat, 25 Apr 2009 21:10:06 +0000 (21:10 +0000)]
Track the usb device state as its powered on, addressed and configured. This helps
to avoid touching the device when it is not going to respond and would otherwise
timeout.

Implement the suspend tracking as a udev state too.

15 years agos/it's/it is/
Marius Strobl [Sat, 25 Apr 2009 20:36:50 +0000 (20:36 +0000)]
s/it's/it is/

15 years agoSync the sparc64 hardware notes with reality, mainly regarding support
Marius Strobl [Sat, 25 Apr 2009 20:31:47 +0000 (20:31 +0000)]
Sync the sparc64 hardware notes with reality, mainly regarding support
of sun4u-machines based on USIII and beyond in 7.2-RELEASE.

Reviewed by: blackend
MFC after: 3 days

15 years agoRemove udp and tcp includes not needed here.
Bjoern A. Zeeb [Sat, 25 Apr 2009 19:14:22 +0000 (19:14 +0000)]
Remove udp and tcp includes not needed here.

Tripped over by: a compile of an upcoming change
MFC after: 1 month

15 years agoTurn MAXPTSDEVS into a sysctl tunable.
Ed Schouten [Sat, 25 Apr 2009 10:05:55 +0000 (10:05 +0000)]
Turn MAXPTSDEVS into a sysctl tunable.

This allows users to increase the maximum amount of pseudo-terminals
without changing any source code. Users must increase UT_LINESIZE before
attempting to increase kern.pts_maxdev.

15 years agoEliminate unnecessary calls to pmap_clear_modify(). Specifically, calling
Alan Cox [Sat, 25 Apr 2009 02:59:06 +0000 (02:59 +0000)]
Eliminate unnecessary calls to pmap_clear_modify().  Specifically, calling
pmap_clear_modify() on a page is pointless if that page is not mapped or
it is only mapped for read access.  Instead, assert that the page is not
mapped or not mapped for write access as appropriate.

Eliminate unnecessary clearing of a page's dirty mask.  Instead, assert
that the page's dirty mask is clear.

15 years agoRemove ghost xntpd directory.
Ed Schouten [Sat, 25 Apr 2009 00:04:36 +0000 (00:04 +0000)]
Remove ghost xntpd directory.

15 years agoIn in_purgemaddrs(), remove the inm being freed from the address list
Robert Watson [Fri, 24 Apr 2009 22:11:53 +0000 (22:11 +0000)]
In in_purgemaddrs(), remove the inm being freed from the address list
before freeing it, rather than vice version, to avoid potential use
after free.

Reviewed by: bms

15 years agoAdd Surecom EP-427X.
Warner Losh [Fri, 24 Apr 2009 17:28:12 +0000 (17:28 +0000)]
Add Surecom EP-427X.

15 years agoAnother PC Card that needs the CIS strings for the Surecom EP-427X,
Warner Losh [Fri, 24 Apr 2009 17:27:45 +0000 (17:27 +0000)]
Another PC Card that needs the CIS strings for the Surecom EP-427X,
which really is just a rebadged OEM card...  Plus a tiny whitespace
nit.

15 years agoSome minor formatting changes to make new text match old style.
Xin LI [Fri, 24 Apr 2009 15:38:13 +0000 (15:38 +0000)]
Some minor formatting changes to make new text match old style.

15 years ago- Add a single line separating two 20090415 entries
Renato Botelho [Fri, 24 Apr 2009 11:34:59 +0000 (11:34 +0000)]
- Add a single line separating two 20090415 entries

Approved by: brueffer

15 years agoAdd UPDATING note about change to struct malloc_type -- following several
Robert Watson [Fri, 24 Apr 2009 09:58:50 +0000 (09:58 +0000)]
Add UPDATING note about change to struct malloc_type -- following several
reports of panics, remind readers that rebuilding kernel modules between
kernel upgrades in HEAD is a good idea.

15 years agoRelocate permissions checking code in in_control() to before the body
Robert Watson [Fri, 24 Apr 2009 09:54:46 +0000 (09:54 +0000)]
Relocate permissions checking code in in_control() to before the body
of the implementation of ioctls.  This makes the mapping of ioctls to
specific privileges more explicit, and also simplifies the
implementation by reducing the use of FALLTHROUGH handling in switch.

While this is not intended to be a functional change, it does mean
that certain privilege checks are now performed earlier, so EPERM
might be returned in preference to EADDRNOTAVAIL for management
ioctls that could have failed for both reasons.

MFC after: 3 weeks

15 years agoZero PCB during early AIM PowerPC init.
Rafal Jaworowski [Fri, 24 Apr 2009 08:57:54 +0000 (08:57 +0000)]
Zero PCB during early AIM PowerPC init.

When memory is not zero'ed by firmware, uninitialized PCB can have bogus
contents, which appear as a saved onfault condition, Altivec context to
restore etc. and lead to corruption/crashes. This commit fixes such issues.

Submitted by: Michal Mazur arg ! semihalf dot com
Tested by: Andreas Tobler andreast-list ! fgznet dot ch

15 years agoo Correct geli(8) command line.
Maxim Konovalov [Fri, 24 Apr 2009 06:44:58 +0000 (06:44 +0000)]
o Correct geli(8) command line.

PR: docs/133961
Submitted by: Aldis Berjoza
MFC after: 1 week

15 years agoAdd suppport for ISA and ISA interrupts to make the ATA
Marcel Moolenaar [Fri, 24 Apr 2009 03:51:11 +0000 (03:51 +0000)]
Add suppport for ISA and ISA interrupts to make the ATA
controller in the VIA southbridge functional in the CDS
(Configurable Development System) for MPC85XX.
The embedded USB controllers look operational but the
interrupt steering is still wrong.

15 years agoRemove isa_irq_pending(). It's not used.
Marcel Moolenaar [Fri, 24 Apr 2009 03:43:20 +0000 (03:43 +0000)]
Remove isa_irq_pending(). It's not used.

15 years agoReimplement bs_be_rs_{1|2|4} and bs_le_rs_{1|2|4} by not
Marcel Moolenaar [Fri, 24 Apr 2009 03:06:32 +0000 (03:06 +0000)]
Reimplement bs_be_rs_{1|2|4} and bs_le_rs_{1|2|4} by not
calling the inline functions in <machine/pio.h> and do
not add synchronization. Implement bs_gen_barrier() as
eieio and sync.

15 years agoRemove PTE_FAKE and PTE_ISFAKE().
Marcel Moolenaar [Fri, 24 Apr 2009 02:55:20 +0000 (02:55 +0000)]
Remove PTE_FAKE and PTE_ISFAKE().

15 years agoRemove PTE_ISFAKE. While here remove code
Marcel Moolenaar [Fri, 24 Apr 2009 02:53:38 +0000 (02:53 +0000)]
Remove PTE_ISFAKE. While here remove code
between "#if 0" and "#endif".

15 years agoRemove spurious 'or'.
Rui Paulo [Thu, 23 Apr 2009 22:08:44 +0000 (22:08 +0000)]
Remove spurious 'or'.

15 years agoReorganize in_control() so that invariants are more obvious, and so
Robert Watson [Thu, 23 Apr 2009 21:41:37 +0000 (21:41 +0000)]
Reorganize in_control() so that invariants are more obvious, and so
that it is easier to lock:

- Handle the unsupported ioctl case at the beginning of in_control(),
  handing off to ifp->if_ioctl, rather than looking up interfaces and
  addresses unnecessarily in this case.

- Make it an invariant that ifp is always non-NULL when running
  in_control()-implemented ioctls, simplifying the code structure.

MFC after: 3 weeks

15 years agofix typo
Kip Macy [Thu, 23 Apr 2009 21:27:06 +0000 (21:27 +0000)]
fix typo

15 years agofix panic when using msix
Kip Macy [Thu, 23 Apr 2009 21:23:19 +0000 (21:23 +0000)]
fix panic when using msix

Pointed out by Nate Whitehorn

15 years agoMake sure the ALTQ case is handle correctly by using drbr_dequeue
Kip Macy [Thu, 23 Apr 2009 21:19:35 +0000 (21:19 +0000)]
Make sure the ALTQ case is handle correctly by using drbr_dequeue

15 years agoDo not call vm_page_lookup() from the ddb routine, namely from "show
Konstantin Belousov [Thu, 23 Apr 2009 21:09:47 +0000 (21:09 +0000)]
Do not call vm_page_lookup() from the ddb routine, namely from "show
vmopag" implementation. The vm_page_lookup() code modifies splay tree
of the object pages, and asserts that object lock is taken. First issue
could cause kernel data corruption, and second one instantly panics the
INVARIANTS-enabled kernel.

Take the advantage of the fact that object->memq is ordered by page index,
and iterate over memq to calculate the runs.

While there, make the code slightly more style-compliant by moving
variables declarations to the right place.

Discussed with: jhb, alc
Reviewed by: alc
MFC after: 2 weeks

15 years agoReduce the number of bounce zones (and thus the number of bounce pages
John Baldwin [Thu, 23 Apr 2009 20:24:19 +0000 (20:24 +0000)]
Reduce the number of bounce zones (and thus the number of bounce pages
used in some cases):
- Ignore DMA tag boundaries when allocating bounce pages.  The boundaries
  don't determine whether or not parts of a DMA request bounce.  Instead,
  they are just used to carve up segments.
- Allow tags with sub-page alignment to share bounce pages since bounce
  pages are always page aligned.

Reviewed by: scottl (amd64)
MFC after: 1 month

15 years agoTwo ifnet misuse fixes for if_nve:
Robert Watson [Thu, 23 Apr 2009 19:29:45 +0000 (19:29 +0000)]
Two ifnet misuse fixes for if_nve:

(1) Don't manually configure if_output(), ether_ifattach() will do that
    for us as part of link-layer setup.

(2) Call if_detach() before stopping nve in order to prevent calls into
    the device driver after the driver has started shutting down.

Reviewed by: jhb
MFC after: 2 weeks

15 years agoCompare protosw pointer with NULL.
Bjoern A. Zeeb [Thu, 23 Apr 2009 17:41:54 +0000 (17:41 +0000)]
Compare protosw pointer with NULL.

MFC after: 1 month

15 years agoAs with ifnet_byindex_ref(), don't return IFF_DYING interfaces from
Robert Watson [Thu, 23 Apr 2009 15:56:01 +0000 (15:56 +0000)]
As with ifnet_byindex_ref(), don't return IFF_DYING interfaces from
ifunit_ref().  ifunit() continues to return them.

MFC after: 3 weeks

15 years agoAdd ifunit_ref(), a version of ifunit(), that returns not just an
Robert Watson [Thu, 23 Apr 2009 13:08:47 +0000 (13:08 +0000)]
Add ifunit_ref(), a version of ifunit(), that returns not just an
interface pointer, but also a reference to it.

Modify ifioctl() to use ifunit_ref(), holding the reference until
all ioctls, etc, have completed.

This closes a class of reader-writer races in which interfaces
could be removed during long-running ioctls, leading to crashes.
Many other consumers of ifunit() should now use ifunit_ref() to
avoid similar races.

MFC after: 3 weeks

15 years agoDuring if_detach(), invoke if_dead() to set the ifnet's function
Robert Watson [Thu, 23 Apr 2009 11:51:53 +0000 (11:51 +0000)]
During if_detach(), invoke if_dead() to set the ifnet's function
pointers to "dead" implementations that no-op rather than invoking
the device driver.  This would generally be unexpected and
possibly quite badly handled by most device drivers after
if_detach() has completed.

Reviewed by: bms
MFC after: 3 weeks

15 years agoMove portions of data structure initialization from if_attach() to
Robert Watson [Thu, 23 Apr 2009 10:59:40 +0000 (10:59 +0000)]
Move portions of data structure initialization from if_attach() to
if_alloc(), and portions of data structure destruction from if_detach()
to if_free().  These changes leave more of the struct ifnet in a
safe-to-access condition between alloc and attach, and between detach
and free, and focus on attach/detach as stack usage events rather than
data structure initialization.

Affected fields include the linkstate task queue, if_afdata lock,
address lists, kqueue state, and MAC labels.  ifq_attach() ifq_detach()
are not moved as ifq_attach() may use a queue length set by the device
driver between if_alloc() and if_attach().

MFC after: 3 weeks

15 years agoAdd a new interface flag, IFF_DYING, which is set when a device driver
Robert Watson [Thu, 23 Apr 2009 09:32:30 +0000 (09:32 +0000)]
Add a new interface flag, IFF_DYING, which is set when a device driver
calls if_free(), and remains set if the refcount is elevated.  IF_DYING
skips the bit in the if_flags bitmask previously used by IFF_NEEDSGIANT,
so that an MFC can be done without changing which bit is used, as
IFF_NEEDSGIANT is still present in 7.x.

ifnet_byindex_ref() checks for IFF_DYING and returns NULL if it is set,
preventing new references from by acquired by index, preventing
monitoring sysctls from seeing it.  Other lookup mechanisms currently
do not check IFF_DYING, but may need to in the future.

MFC after: 3 weeks

15 years agoLet pflogd's Makefile just use WARNS instead of changing CFLAGS.
Ed Schouten [Thu, 23 Apr 2009 09:11:37 +0000 (09:11 +0000)]
Let pflogd's Makefile just use WARNS instead of changing CFLAGS.

This change allows me to disable -Werror by using NO_WERROR. Right now
I can't build pflogd using Clang, because Clang generates more warnings
when passing -Wall.

15 years agoCorrect the information about when the respective functionality first
Christian Brueffer [Thu, 23 Apr 2009 08:37:56 +0000 (08:37 +0000)]
Correct the information about when the respective functionality first
appeared in FreeBSD.

PR: 133785
Submitted by: Ulrich Spoerlein <uqs@spoerlein.net>
MFC after: 3 days

15 years ago- Whitespace nitpicking.
Stanislav Sedov [Thu, 23 Apr 2009 00:00:57 +0000 (00:00 +0000)]
- Whitespace nitpicking.

15 years ago- Add the driver for AT91RM9200 CompactFlash controller. The driver
Stanislav Sedov [Wed, 22 Apr 2009 23:54:41 +0000 (23:54 +0000)]
- Add the driver for AT91RM9200 CompactFlash controller. The driver
  operates in the common memory mode and use polling mode to control
  the status of operations as I don't have any board with interrupt
  line routed yet. I'll add the GPIO interrupt driven mode as soon
  as I get one.

15 years agoAdjust the way we number CPUs on x86 so that we attempt to "group" all
John Baldwin [Wed, 22 Apr 2009 21:40:37 +0000 (21:40 +0000)]
Adjust the way we number CPUs on x86 so that we attempt to "group" all
logical CPUs in a package.  We do this by numbering the non-boot CPUs
by starting with the first CPU whose APIC ID is after the boot CPU and
wrapping back around to APIC ID 0 if needed rather than always starting
at APIC ID 0.  While here, adjust the cpu_mp_announce() routine to list
CPUs based on the mapping established by assign_cpu_ids() rather than
making assumptions about the algorithm assign_cpu_ids() uses.

MFC after: 1 month

15 years agoCorrect a comment: the function name given had never existed in any
Bjoern A. Zeeb [Wed, 22 Apr 2009 20:49:54 +0000 (20:49 +0000)]
Correct a comment: the function name given had never existed in any
(relevant) version of this file orany of my patches.

MFC after: 1 month

15 years agoMFp4 //depot/projects/usb@160930
Andrew Thompson [Wed, 22 Apr 2009 17:08:16 +0000 (17:08 +0000)]
MFp4 //depot/projects/usb@160930

Change the roothub exec functions to take the usb request and data pointers
directly rather than placing them on the parent bus struct.

Submitted by: Hans Petter Selasky

15 years agoMFp4 //depot/projects/usb@160708
Andrew Thompson [Wed, 22 Apr 2009 17:08:13 +0000 (17:08 +0000)]
MFp4 //depot/projects/usb@160708

Need to check Read/Write allowed before writing any data for non-control
transfers.

Submitted by: Hans Petter Selasky

15 years agoMFp4 //depot/projects/usb@160706
Andrew Thompson [Wed, 22 Apr 2009 17:08:10 +0000 (17:08 +0000)]
MFp4 //depot/projects/usb@160706

Resolve possible device side mode deadlock by creating another thread.

Submitted by: Hans Petter Selasky

15 years agoMFp4 //depot/projects/usb@160678
Andrew Thompson [Wed, 22 Apr 2009 17:08:07 +0000 (17:08 +0000)]
MFp4 //depot/projects/usb@160678

Remove unused field.

Submitted by: Hans Petter Selasky

15 years agoMFp4 //depot/projects/usb@160655
Andrew Thompson [Wed, 22 Apr 2009 17:08:04 +0000 (17:08 +0000)]
MFp4 //depot/projects/usb@160655

Fix possible issue with clear-stall and set-config happening at the same time.

Submitted by: Hans Petter Selasky

15 years agoMFp4 //depot/projects/usb@160614
Andrew Thompson [Wed, 22 Apr 2009 17:07:59 +0000 (17:07 +0000)]
MFp4 //depot/projects/usb@160614

Fix errornous printout.

Submitted by: Hans Petter Selasky

15 years agoMFp4 //depot/projects/usb@160485
Andrew Thompson [Wed, 22 Apr 2009 17:07:56 +0000 (17:07 +0000)]
MFp4 //depot/projects/usb@160485

Fix a bug in the USB power daemon code where connection of multiple HUBs in
series would result in incorrect device suspend.

Reported by: Nicolas xxx@wanadoo.fr
Submitted by: Hans Petter Selasky

15 years agoMFp4 //depot/projects/usb@160413
Andrew Thompson [Wed, 22 Apr 2009 17:07:53 +0000 (17:07 +0000)]
MFp4 //depot/projects/usb@160413

Use direct reference to parent high-speed HUB instead of indirect, due to
pointer clearing race at detach of parent USB HUB.

Reported by: kientzle
Submitted by: Hans Petter Selasky
PR: usb/133545

15 years agoA couple of older Melco cards that missed the transition to newcard
Warner Losh [Wed, 22 Apr 2009 16:51:01 +0000 (16:51 +0000)]
A couple of older Melco cards that missed the transition to newcard

15 years agoA couple of older Melco cards that missed the transition to newcard
Warner Losh [Wed, 22 Apr 2009 16:50:44 +0000 (16:50 +0000)]
A couple of older Melco cards that missed the transition to newcard

15 years agoAdd bm(4) to the built-in ethernet devices list.
Nathan Whitehorn [Wed, 22 Apr 2009 16:06:46 +0000 (16:06 +0000)]
Add bm(4) to the built-in ethernet devices list.