Commit Graph

47690 Commits

Author SHA1 Message Date
John Baldwin
a5471e4ef4 Remove the signal_caught argument from sleepq_timedwait() as it was
effectively always zero.
2004-06-28 18:57:06 +00:00
Warner Losh
4c0142a129 another format nit 2004-06-28 16:38:53 +00:00
Warner Losh
7f9369480d casting for printf happiness 2004-06-28 16:30:49 +00:00
John Baldwin
bd83e879fd - Execute all of the tasks on the taskqueue during taskqueue_free() after
the queue has been removed from the global taskqueue_queues list.  This
  removes the need for the draining queue hack.
- Allow taskqueue_run() to be called with the taskqueue mutex held.  It
  can still be called without the lock for API compatiblity.  In that case
  it will acquire the lock internally.
- Don't lock the individual queue mutex in taskqueue_find() until after the
  strcmp as the global queues mutex is sufficient for the strcmp.
- Simplify taskqueue_thread_loop() now that it can hold the lock across
  taskqueue_run().

Submitted by:	bde (mostly)
2004-06-28 16:28:23 +00:00
Warner Losh
b5ba0c50e8 We need to build miidevs.h when we have miibus, not mii. 2004-06-28 16:22:20 +00:00
John Baldwin
469085eb86 Adjust the priorities of software interrupts. Bump SWI_CLOCK up to 5
and bump all of the taskqueue swi's to 6.  This gives callouts higher
priority than taskqueue tasks and gives all taskqueue tasks the same
priority.

Discussed with:	bde
2004-06-28 16:21:51 +00:00
John Baldwin
c086588f32 Adjust the priority of the idle threads to be the lowest possible
priority.  This is just a comestic nit as the idle thread priorities aren't
used by the schedulers.

Reported by:	bde
2004-06-28 16:19:50 +00:00
John Baldwin
3df6c4de7e - Shorten the names for the TTY related swi interrupt handlers as the
'tty:' prefix is largely redundant.
- Fix the priority of the low-priority TTY SWIs that are hung off of the
  softclock thread.

Submitted by:	bde (2)
2004-06-28 16:17:11 +00:00
Roman Kurakin
e874bf6648 Do not m_free packet since IF_HANDOFF (called from netisr_queue) will
do it for us, just count it.
2004-06-28 15:32:24 +00:00
Yoshihiro Takahashi
3fdb25139d Merged from sys/dev/sio/sio.c revision 1.444. 2004-06-28 13:28:20 +00:00
Olivier Houchard
3502f85d84 Remove unused includes.
Spotted out by:	pjd
2004-06-28 11:35:05 +00:00
Warner Losh
dc7949f45f bde points out that this can't do anything useful. The full patch has
other parts that I can't locat at the moment, so back it out until I can.
2004-06-28 05:37:22 +00:00
Scott Long
770fffe05b Retire BUS_DMAMAP_NSEGS for sparc64 2004-06-28 04:04:43 +00:00
Scott Long
8e0bfc6b32 Switch sparc64 busdma to use a dynamically allocated segment list rather
than a a stack-limited list.  This removes the artifical limit on s/g list
size.
cvs: ----------------------------------------------------------------------
2004-06-28 03:49:13 +00:00
Warner Losh
29b95d5a7e Turns out that jhb didn't really like this. And nate pointed out that
it wasn't a good idea to have the test for NULL on only a limited
subset.  Go back because I'm not sure adding NULL to all the others is
a good idea.
2004-06-28 03:40:23 +00:00
Warner Losh
ed67d9de40 rman_reserve_resource doesn't set the bushandle, so we have to do it here.
Badness noted by: njl
Perforce reply not read by: imp
2004-06-28 03:36:37 +00:00
Warner Losh
f465e257e2 When opening /dev/io, preserve iopl properly. Otherwise, if you open
/dev/io multiple times, the first close remove the privs.
2004-06-28 03:16:32 +00:00
Warner Losh
cb490814b9 remove needless blankline 2004-06-28 03:08:17 +00:00
Warner Losh
15442f461b Use APM_UNKNOWN instead of 0xff. Use ~0U instead 0 for the number of
batteries.  This should be -1 to match other code, but since the api
is unsigned ~0U is the same thing.
2004-06-28 02:38:20 +00:00
Warner Losh
d5ca7f4f2b Allow dev to be NULL and assume that a device is not alive or not
attached.

Reviewed by: njl(?) and jhb
2004-06-28 02:24:04 +00:00
Warner Losh
6324e64978 We don't need GEN_M_CFILES. Fold it into GEN_CFILES definition and
adjust as necessary.

Suggested by: bde
2004-06-27 23:03:43 +00:00
Poul-Henning Kamp
e3e244bff6 Rwatson, write 100 times for tomorrow:
First unlock, then assign NULL to pointer.
2004-06-27 21:54:34 +00:00
Poul-Henning Kamp
52c583feb9 Make sure to kill the devstat entry for disappearing disks.
PR:	68074
Submitted by:	Hendrik Scholz <hscholz@raisdorf.net>
2004-06-27 20:53:20 +00:00
Warner Losh
e9f58c27b9 Only build miidevs.h when we have mii in the kernel
Only build pccarddevs.h when we have pccard in the kernel
Only build usbdevs.h when we have usb in the kernel

Suggested by: bde
2004-06-27 20:16:56 +00:00
Alexander Langer
52b8c8cd00 - Fix style bug in Dell Bluetooth adapter (don't repeat Vendor in
device listing).
- Add generic "Port Replicator" entry for the USB Hubs used in
  Dell port replicators.
2004-06-27 17:27:04 +00:00
Warner Losh
0661633386 Now that all the in-tree referrences to these old files are gone, go
ahead and remove them.
2004-06-27 16:59:15 +00:00
Warner Losh
107af8f9eb MFp4: Last references to dev/usb/usbdevs.h converted. 2004-06-27 16:51:01 +00:00
Warner Losh
39bd8f0099 MFp4:
Add Intel Pro100Lan56 card.

Also integrate changes from Carlos Velasco.  Only attch if we're a
network device (to filter out the serial devices).  Also, increment
vpmatch if we match to conform to the pccard match function api.
2004-06-27 13:25:28 +00:00
Warner Losh
5af9f729ec MFp4:
Use bus space rather than direct inb/outb.  Minor style changes while
I'm here.  Extremely preliminary support for siliconix ethernet cards
(but more work is required).
2004-06-27 13:10:20 +00:00
Warner Losh
5d11e83faa MFp4:
The hack for setting the bus has been moved down into the cbb driver.
I've been running without this hack in my tree for so long I had
forgotten that I'd removed it :-).  Please let me know if this causes
difficulty for your laptop.
2004-06-27 13:07:02 +00:00
Warner Losh
a323657048 MFp4: Set the bus handle to the bus handle of the resource, not the
starting value.  This is more pedantically correct (since the handle
isn't always identical to the start of the resource) and also doesn't
access the innards of struct resource direct (which I forbid in my
tree).  We need to do this for all resource types, not just ioport.

Reviewed by: njl
2004-06-27 13:04:19 +00:00
Pawel Jakub Dawidek
55336b83e0 Introduce a hack that will make geom_gate to work with read-only mounts.
Now, when trying to mount file system in read-only mode it tries to
opened a device for writting to be able to update to read-write mode
latter. Ehh.

Discussed with:	phk
2004-06-27 12:56:11 +00:00
Warner Losh
d1458cfdf4 MFp4: First batch of dev/usb/usbdevs.h -> usbdevs.h changes. 2004-06-27 12:41:44 +00:00
Warner Losh
4c42b42a79 Add usbdevs.h and pccarddevs.h to the build list, as appropriate. This is needed to build as part of world or in src/sys/modules. 2004-06-27 12:33:20 +00:00
Poul-Henning Kamp
ae404e3427 Guard against us having no tty pointer. 2004-06-27 11:29:54 +00:00
Jens Schweikhardt
5383b89356 Fix a tuner problem.
PR:		kern/66006
Submitted by:	Josh Elsasser <jre@vineyard.net>
MFC after:	1 week
2004-06-27 09:59:02 +00:00
Pawel Jakub Dawidek
0a44517d3a Those are unneeded too. 2004-06-27 09:06:10 +00:00
Pawel Jakub Dawidek
46e3b1cbe7 Add two missing includes and remove two uneeded.
This is quite serious fix, because even with MAC framework compiled in,
MAC entry points in those two files were simply ignored.
2004-06-27 09:03:22 +00:00
Robert Watson
7717cf07f8 Acquire the socket buffer lock when calling unp_scan() on
so->so_rcv.sb_mb to prevent the mbuf chain from changing during the
scan.
2004-06-27 03:29:25 +00:00
Robert Watson
91e45cce19 Annotate so_gencnt field of struct socket locked by so_global_mtx. 2004-06-27 03:23:09 +00:00
Robert Watson
a290574663 Add a new global mutex, so_global_mtx, which protects the global variables
so_gencnt, numopensockets, and the per-socket field so_gencnt.  Annotate
this this might be better done with atomic operations.

Annotate what accept_mtx protects.
2004-06-27 03:22:15 +00:00
Robert Watson
d07af9d904 Add options NETGRAPH_FEC to hook up ng_fec.c to the LINT build. 2004-06-27 02:36:33 +00:00
Robert Watson
9d56413324 Add options NETGRAPH_EIFACE, which causes ng_eiface.c to be built into
the kernel, similar to NETGRAPH_IFACE for ng_iface.c.  It appears to
have been omitted when added to the kernel.
2004-06-27 02:25:38 +00:00
David Schultz
17d9d0d049 Update a stale comment. The heuristic to swap processes out based on
the number of pages already paged out was broken in rev 1.10 and
removed in rev 1.11.
2004-06-27 01:58:12 +00:00
Robert Watson
5706472c3a The g_up and g_down threads use a local 'mymutex' mutex to allow WITNESS
to warn about attempts to sleep in the I/O path.  This change pushes the
definition and use of 'mymutex' behind #ifdef WITNESS to avoid the cost
in non-debugging cases.  This results in a clear .22% performance win for
512 byte and 1k I/O tests on my SMP test box.  Not much, but every bit
counts.
2004-06-26 23:27:42 +00:00
Julian Elischer
3ca24c284d Having moved metadata usage to mbuf tags, remove code that supports
the old way of doing it.

Submitted by:	Gleb Smirnoff <glebius@cell.sick.ru>
2004-06-26 22:24:16 +00:00
Alan Cox
d9dd6bfb56 Remove an unused field from the vmspace structure. 2004-06-26 19:16:35 +00:00
Robert Watson
1e4d7da707 Reduce the number of unnecessary unlock-relocks on socket buffer mutexes
associated with performing a wakeup on the socket buffer:

- When performing an sbappend*() followed by a so[rw]wakeup(), explicitly
  acquire the socket buffer lock and use the _locked() variants of both
  calls.  Note that the _locked() sowakeup() versions unlock the mutex on
  return.  This is done in uipc_send(), divert_packet(), mroute
  socket_send(), raw_append(), tcp_reass(), tcp_input(), and udp_append().

- When the socket buffer lock is dropped before a sowakeup(), remove the
  explicit unlock and use the _locked() sowakeup() variant.  This is done
  in soisdisconnecting(), soisdisconnected() when setting the can't send/
  receive flags and dropping data, and in uipc_rcvd() which adjusting
  back-pressure on the sockets.

For UNIX domain sockets running mpsafe with a contention-intensive SMP
mysql benchmark, this results in a 1.6% query rate improvement due to
reduce mutex costs.
2004-06-26 19:10:39 +00:00
Alan Cox
df68e345c5 In case pmap_extract_and_hold() is ever performed on a different pmap than
the current one, we need to pin the current thread to its CPU.

Submitted by:	tegge@
2004-06-26 19:10:12 +00:00
Marcel Moolenaar
247aba2474 Allocate TIDs in thread_init() and deallocate them in thread_fini().
The overhead of unconditionally allocating TIDs (and likewise,
unconditionally deallocating them), is amortized across multiple
thread creations by the way UMA makes it possible to have type-stable
storage.
Previously the cost was kept down by having threads created as part
of a fork operation use the process' PID as the TID. While this had
some nice properties, it also introduced complexity in the way TIDs
were allocated. Most importantly, by using the type-stable storage
that UMA gives us this was also unnecessary.

This change affects how core dumps are created and in particular how
the PRSTATUS notes are dumped. Since we don't have a thread with a
TID equalling the PID, we now need a different way to preserve the
old and previous behavior. We do this by having the given thread (i.e.
the thread passed to the core dump code in td) dump it's state first
and fill in pr_pid with the actual PID. All other threads will have
pr_pid contain their TIDs. The upshot of all this is that the debugger
will now likely select the right LWP (=TID) as the initial thread.

Credits to: julian@ for spotting how we can utilize UMA.
Thanks to: all who provided julian@ with test results.
2004-06-26 18:58:22 +00:00
Robert Watson
3f9d1ef905 Remove spl's from TCP protocol entry points. While not all locking
is merged here yet, this will ease the merge process by bringing the
locked and unlocked versions into sync.
2004-06-26 17:50:50 +00:00
Mike Pritchard
3c7c6c12cf Spelling fixes. 2004-06-26 17:19:44 +00:00
Robert Watson
11c40a39b6 Replace comment on spl state when calling soabort() with a comment on
locking state.  No socket locks should be held when calling soabort()
as it will call into protocol code that may acquire socket locks.
2004-06-26 17:12:29 +00:00
Lukas Ertl
f3617a3396 Catch up with usbd_get_string_desc() change.
Spotted by:  Tai-hwa Liang <avatar@mmlab.cse.yzu.edu.tw>
2004-06-26 13:24:29 +00:00
Lukas Ertl
5d4284a178 Catch up with usbd_get_string_desc() change. 2004-06-26 13:21:31 +00:00
Lukas Ertl
35ea382b1a Our softc has no sc_hdev, but a sc_dev. This in turn has no direct
sc_parent, so back out the previous commit, as it breaks the build.

If there's a pointy hat left, pass it on.
2004-06-26 13:12:46 +00:00
Lukas Ertl
5bebcf6d1c MFNetBSD.
uhid.c (1.61), author: jdolecek
   add support for USB_GET_DEVICEINFO and USB_GET_STRING_DESC ioctls,
   with same meaning as for ugen(4)

usbdi_util.h (1.29), usb_quirks.c (1.50), uhid.c (1.62),
ugen.c (1.68), usb_subr.c (1.114) author: mycroft
   Yes, some devices return incorrect lengths in their string
   descriptors.  Rather than losing, do what Windows does: just
   request the maximum size, and allow a shorter response.  Obsoletes
   the need for UQ_NO_STRINGS, and therefore these "quirks" are removed.

usb_subr.c (1.116), author: mycroft
    In the "seemed like a good idea until I found the fatal flaw"
    department...  Attempting to read a maximum-size string descriptor
    causes my kue device to go completely apeshit.  So, go back to the
    original method, but allow the device to return a shorter string than
    it claimed.

Obtained from:   NetBSD
2004-06-26 10:35:10 +00:00
Poul-Henning Kamp
cb9ea5f4cb Pick the hotchar out of the tty structure instead of caching private
copies.

No current line disciplines have a dynamically changing hotchar, and
expecting to receive anything sensible during a change in ldisc is
insane so no locking of the hotchar field is necessary.
2004-06-26 09:20:07 +00:00
Lukas Ertl
57ceda5d84 MFNetBSD.
ohci.c (1.147), author: mycroft
   Failure to properly mask off UE_DIR_IN from the endpoint address
   was causing OHCI_ED_FORMAT_ISO and EHCI_QH_HRECL to get set
   spuriously, causing rather interesting lossage.

   Suddenly I get MUCH better performance with ehci...

ohci.c (1.148), author: mycroft
   Adjust a couple of comments to make it clear WTF is going on.

Obtained from:   NetBSD
2004-06-26 09:19:31 +00:00
Poul-Henning Kamp
4776c07426 Fix line discipline switching issues: If opening a new ldisc fails,
we have to revert to TTYDISC which we know will successfully open
rather than try the previous ldisc which might also fail to open.

Do not let ldisc implementations muck about with ->t_line, and remove
code which checks for reopens, it should never happen.

Move ldisc->l_hotchar to tty->t_hotchar and have ldisc implementation
initialize it in their open routines.  Reset to zero when we enter
TTYDISC.  ("no" should really be -1 since zero could be a valid
hotchar for certain old european mainframe protocols.)
2004-06-26 08:44:04 +00:00
Warner Losh
b53dd31ab9 MFp4:
Now that the devs files are marked before-depend, we can remvoe them
from a few places they were explicitly mentioned (along with
BEFORE_DEPEND).

Noticed by: bde
2004-06-26 06:02:06 +00:00
Warner Losh
09c399ec0e MFp4:
Reduce the need for hard coded *devs in various makefiles by declaring
them before-depend.

Other bugs in the handling of *devs remain, but this is the start of
the cleanup.  These will be address in future commits.

Cleanup Motivator: bde
2004-06-26 05:58:43 +00:00
Yoshihiro Takahashi
dcfafc520f Merged from sys/dev/sio/sio.c revision 1.442.
(Use generic support for modemcontrol and BREAK ioctls.)
2004-06-26 04:00:46 +00:00
Julian Elischer
1020444971 Not quite sure how that one got past me.. 2004-06-26 01:22:29 +00:00
Lukas Ertl
dae4042053 MFNetBSD ehci.c and ehcireg.h
ehci.c (1.55), ehcireg.h (1.16); author: mycroft
     Set the data toggle correctly, and use EHCI_QTD_DTC.  This fixes
     problems with my ALi-based drive enclosure (it works now, rather
     than failing to attach).  Also seems to work with a GL811-based
     enclosure and an ASUS enclosure with a CD-RW, on both Intel and
     NEC controllers.

     Note: The ALi enclosure is currently very SLOW, due to some issue
     with taking too long to notice that the QTD is complete.  This
     requires more investigation.

ehci.c (1.56); author: mycroft
     Failure to properly mask off UE_DIR_IN from the endpoint address
     was causing OHCI_ED_FORMAT_ISO and EHCI_QH_HRECL to get set
     spuriously, causing rather interesting lossage.

     Suddenly I get MUCH better performance with ehci...

ehci.c (1.58); author: mycroft
     Fix a stupid bug in ehci_check_intr() that caused use to try to
     complete a transaction that was still running.  Now ehci can
     handle multiple devices being active at once.

ehci.c (1.59); author: enami
     As the ehci_idone() now uses the variable `epipe'
     unconditionally, always declare it (in other words, make this
     file compile w/o EHCI_DEBUG).

ehci.c (1.60); author: mycroft
     Remove comment about the data toggle being borked.

ehci.c (1.61); author: mycroft
     Update comment.

ehci.c (1.62); author: mycroft
     Adjust a couple of comments to make it clear WTF is going on.

ehci.c (1.63); author: mycroft
     Fix an error in a debug printf().

ehci.c (1.64), ehcireg.h (1.17); author: mycroft
     Further cleanup of toggle handling.  Now that we use EHCI_QH_DTC,
     we don't need to fiddle with the TOGGLE bit in the overlay
     descriptor, so minimize how much we fuss with it.

Obtained from:   NetBSD
2004-06-26 00:52:37 +00:00
Marcel Moolenaar
cfdb160e31 Add type definitions for prgregset_t and psaddr_t. Both are used by
the proc services API. The prfpregset_t type already existed.
2004-06-25 23:06:20 +00:00
Maksim Yevmenkin
21da572743 Add '#include <sys/mbuf.h>' to fix the kernel build. 2004-06-25 23:03:33 +00:00
Julian Elischer
601c644f46 oops from Gleb..
This shouldn't be visible from userland.

Submitted by:	Gleb Smirnoff <glebius@cell.sick.ru>
2004-06-25 22:59:59 +00:00
Poul-Henning Kamp
ccfac9e40e Gah! commit from wrong tree.
Remove now unused variables from last commit.
2004-06-25 22:10:20 +00:00
Poul-Henning Kamp
950cce9b30 Retire the TIOC_REMOTE ioctl.
It was added 22 years ago for emacs to use, but emacs gave up on it
it 17 years ago.
2004-06-25 21:54:49 +00:00
Søren Schmidt
dfc7e0081f Add support for LSI type software RAID's.
Made possible by: John Cagle @ HP
2004-06-25 21:21:59 +00:00
Julian Elischer
1cf3fa7934 Make the frameworkl responsible for not passing the nodes a NULL mbuf pointer.
this allows the nodes to not test for this..

Submitted by:	Gleb Smirnoff <glebius@cell.sick.ru>
2004-06-25 21:11:14 +00:00
Poul-Henning Kamp
45671a9eb6 Use generic routines for BREAK and modem control ioctls.
This eliminates the need for a local ioctl method.
2004-06-25 20:33:52 +00:00
Poul-Henning Kamp
89274131e2 Use generic modem control and BREAK ioctl handling. This eliminated
the need for a local ioctl handler.
2004-06-25 20:32:51 +00:00
Robert Watson
a5993a9778 Release UNIX domain socket subsystem lock earlier -- don't need to
hold it over free of unp_addr if we've already removed all references
to unp.
2004-06-25 20:12:06 +00:00
Julian Elischer
327b288e5c Convert Netgraph to use mbuf tags to pass its meta information around.
Thanks to Sam for importing tags in a way that allowed this to be done.

Submitted by:	Gleb Smirnoff <glebius@cell.sick.ru>
Also allow the sr and ar drivers to create netgraph versions of their modules.
Document the change to the ksocket node.
2004-06-25 19:22:05 +00:00
Lukas Ertl
865897c9f1 Mark a plex as 'newborn' when it is created. This is used to indicate
that new RAID5 plexes need to be initialized first.
2004-06-25 18:04:33 +00:00
Josef El-Rayes
ae6d3a22dc Fix uninitialized variable, that breaks the build.
Approved by: hmp
Reviewed by: chris
Pointy hat to: josef (for ignoring warning)
2004-06-25 16:34:33 +00:00
Peter Grehan
a4d9d1bc90 Catch up with sparc64 OFWCONS_POLL_HZ change 2004-06-25 13:44:34 +00:00
Peter Grehan
aa77148daf - set resid correctly so that a failed seek (e.g. end of file) returns
correctly
- included required <sys/module.h>
2004-06-25 13:43:56 +00:00
Peter Grehan
40cdee9dab Catchup to now-required <sys/module.h> for PowerPC 2004-06-25 13:42:48 +00:00
Poul-Henning Kamp
f1cd2fdf61 Make the relationship between modem control bits and their delta cousins
public.
2004-06-25 10:56:43 +00:00
Poul-Henning Kamp
4550ad5b99 Use generic support for BREAK and modem control ioctls 2004-06-25 10:54:46 +00:00
Poul-Henning Kamp
96df2b0bfb Use generic support for BREAK and modem control ioctls. 2004-06-25 10:54:05 +00:00
Poul-Henning Kamp
85bc8ea7fc Use generic support for modemcontrol and BREAK ioctls. 2004-06-25 10:51:33 +00:00
Roman Kurakin
1127aac31e Do not count loobacks as other fuilures.
As a result magic will not be rejected any more in case of loopback.

Discussed with:	joerg@
2004-06-25 10:25:33 +00:00
Poul-Henning Kamp
e77b206f0e Add two new methods to struct tty: One for manipulating BREAK condition
and one for fiddling modem-control signals.

Add generic code to deal with the relevant ioctls if these methods are
present.
2004-06-25 10:24:10 +00:00
Paul Saab
652178a12a White space & spelling fixes
Submitted by:	Xin LI <delphij@frontfree.net>
2004-06-25 04:11:26 +00:00
Bruce M Simpson
37332f049f Whitespace. 2004-06-25 02:29:58 +00:00
Brian Feldman
2a7be1b6d1 Correct the tracking of various bits of the process's vmspace and vm_map
when not propogated on fork (due to minherit(2)).  Consistency checks
otherwise fail when the vm_map is freed and it appears to have not been
emptied completely, causing an INVARIANTS panic in vm_map_zdtor().

PR:		kern/68017
Submitted by:	Mark W. Krentel <krentel@dreamscape.com>
Reviewed by:	alc
2004-06-24 22:43:46 +00:00
Robert Watson
12ec7658a4 Annotate that we don't check the returned data length from ufs_readdir()
because UFS uses fixed-size directory blocks.  When using this code with
other file systems, such as HFS+, the value of auio.uio_resid will need
to be taken into account.
2004-06-24 18:31:23 +00:00
Scott Long
c63d83f7c2 Fix a typo that made the busdma tag have a 0 highaddr. This driver heavily
abuses busdma in other ways, and those will likely be fixed another day.
2004-06-24 18:30:08 +00:00
Doug Ambrisko
c3c409c498 Add PCI Device ID for 6300ESB ICH. If allocating 16 bytes fails then try 32.
This is also require for 6300ESB.
2004-06-24 18:21:28 +00:00
Robert Watson
bb0527fdd3 Remove unnecessary setting of VV_SYSTEM on extended attribute backing
files.  When this flag is used in our port of this code to Darwin, it
caused remarkable pain, and doesn't offer a benefit in FreeBSD.
2004-06-24 18:17:41 +00:00
Josef El-Rayes
06fc89cc3a Remove the entry for configuring pcm0 mixer channels.
This is accomplished via device.hints now.
2004-06-24 17:49:18 +00:00
Robert Watson
00a460dcf4 Protect a non-text comment with a '-'. 2004-06-24 17:45:45 +00:00
Robert Watson
cd39d9b661 White space cleanup: use spaces instead of tabs in variable declarations
local to a function.  Remove a couple of blank lines in variable
declarations.

In one case, explicitly test against NULL rather than using a pointer
as a boolean directly.
2004-06-24 17:44:14 +00:00
Josef El-Rayes
8ba7f5cfee Change the possibility to configure pcm(4) via boot/loader.conf
to use boot/device.hints now

As discussed on cvs-src@

Reviewed by:	Hiten Pandya <hmp@backplane.com>
2004-06-24 17:41:20 +00:00
Robert Watson
4f3bf9b9b4 Don't cuddle else's so much as we removed additional parts of each
block.
2004-06-24 17:22:29 +00:00
Robert Watson
5e11031e05 Remove temporary API bandage that allowed applications speaking the
older API to list attributes on a file (zero-length attribute name)
to function.  extattr_list_*() are now the only available APIs to
use when listing attributes.
2004-06-24 17:14:28 +00:00
Joerg Wunsch
b46f884b80 Add a couple of #ifdef DEBUG printf()s in vlan_input() I found to be
useful when debugging the ether_demux() problem (when bridging over
VLANs).
2004-06-24 12:32:41 +00:00
Joerg Wunsch
cd0cd0149b When considering an ethernet frame that is not destined for us, do not
only allow this to be further processed when bridging is active on
that interface, but also if the current packet has a VLAN tag and
VLANs are active on our interface.  This gives the VLAN layers a
chance to also consider the packet (and perhaps drop it instead of the
main dispatcher).

This fixes a situation where bridging was only active on VLAN
interfaces but ether_demux() called on behalf of the main interface
had already thrown the packet away.

MFC after:	4 weeks
2004-06-24 12:31:44 +00:00
Dag-Erling Smørgrav
d7647d966e Make dependencies on the TCP/IP stack conditional on INET / INET6. This
makes it possible to build a kernel with NIC drivers but no TCP/IP stack.

Sponsored by:	Teleplan AS
2004-06-24 10:58:08 +00:00
Pawel Jakub Dawidek
40f798dad1 Don't force class to give a valid softc to g_slice_new(), it is not always
needed.

Approved by:	phk
2004-06-24 10:50:20 +00:00
Poul-Henning Kamp
075ef10234 #include <sys/serial.h> 2004-06-24 10:32:30 +00:00
Poul-Henning Kamp
eb02dd6892 Use the correct names for modem control signals as the primary and make
the aliases aliases.
2004-06-24 10:20:53 +00:00
Poul-Henning Kamp
28710806cb Use the new serial port definitions for modemsignals. 2004-06-24 10:07:28 +00:00
Poul-Henning Kamp
98de21b633 Use CTASSERT to enforce the relationship between the new serial port
modem definitions and the old definitions from ioctls.
2004-06-24 10:06:55 +00:00
Poul-Henning Kamp
c56bdd05fa Add a tty-independent include file for definitions pertaining to serial
ports.

Define the most commonly used modem signals, and delta-bit definitions
for them.
2004-06-24 10:05:58 +00:00
Nate Lawson
bef5734687 Update some comments and remove non-standard notation. 2004-06-24 06:37:23 +00:00
Nate Lawson
684c1c1ddb Hook acpi_quirks up to the build for kernel and modules. 2004-06-24 06:29:22 +00:00
Nate Lawson
94f529791f Add a script to parse acpi_quirks into a header file that we can compile
into ACPI.  Script written by Mark Santcroos with some edits from myself.

Submitted by:	marks
2004-06-24 06:28:05 +00:00
Nate Lawson
e008d0c51c Add a quirks array based on matching ACPI tables. The entries in this file
are currently all bad BIOS revisions that will never be able to support
ACPI.  They were derived by examining which BIOS's are blacklisted by other
operating systems.  Other types of quirks will be possible here as well.
2004-06-24 06:27:05 +00:00
John Birrell
bbfccfb3c6 Sync to usbdevs 1.183 2004-06-24 05:25:04 +00:00
John Birrell
f1912fcf16 Add Delorme Publishing Earthmate GPS 2004-06-24 05:05:56 +00:00
Robert Watson
613a4366cb Acquire the receive socket buffer lock when modifying out-of-band
data fields of the socket in SPX.
2004-06-24 04:29:53 +00:00
Robert Watson
c6b93bf29a Lock socket buffers when processing setting socket options SO_SNDLOWAT
or SO_RCVLOWAT for read-modify-write.
2004-06-24 04:28:30 +00:00
Robert Watson
63a9224f4c Annotate so_error as being used for simple assignment and reads, and
therefore not locked.

Assert the socket buffer lock in sowwakeup_locked() to match
sorwakeup_locked().
2004-06-24 04:27:10 +00:00
Alan Cox
5e609009de Call vm_pageout_page_stats() with the page queues lock held. 2004-06-24 04:08:43 +00:00
Robert Watson
2220907b6e Introduce a temporary mutex, mac_ifnet_mtx, to lock MAC labels on
network interfaces.  This global mutex will protect all ifnet labels.
Acquire the mutex across various MAC activities on interfaces, such
as security checks, propagating interface labels to mbufs generated
from the interface, retrieving and setting the interface label.

Introduce mpo_copy_ifnet_label MAC policy entry point to copy the
value of an interface label from one label to another.  Use this
to avoid performing a label externalize while holding mac_ifnet_mtx;
copy the label to a temporary ifnet label and then externalize that.

Implement mpo_copy_ifnet_label for various MAC policies that
implement interface labeling using generic label copying routines.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, McAfee Research
2004-06-24 03:34:46 +00:00
Alan Cox
1aab16a6b6 Remove spl calls. 2004-06-24 03:13:30 +00:00
Robert Watson
d60454e33a Annotate which SB_ constants are for sb_flags fields. 2004-06-24 03:12:46 +00:00
Robert Watson
7322ba7d8b When updating sb_flags, acquire the socket buffer lock to prevent
races.
2004-06-24 03:12:13 +00:00
Robert Watson
c17a7759af Constify send and receive space constants in natm. 2004-06-24 03:11:29 +00:00
Robert Watson
5905999b2f Broaden scope of the socket buffer lock when processing an ACK so that
the read and write of sb_cc are atomic.  Call sbdrop_locked() instead
of sbdrop() since we already hold the socket buffer lock.
2004-06-24 03:07:27 +00:00
Robert Watson
927c5cea3f Protect so_oobmark with with SOCKBUF_LOCK(&so->so_rcv), and broaden
locking in tcp_input() for TCP packets with urgent data pointers to
hold the socket buffer lock across testing and updating oobmark
from just protecting sb_state.

Update socket locking annotations
2004-06-24 02:57:12 +00:00
David E. O'Brien
a82b25f9b2 Better OFW console support on Sun Ultra2 machines.
Ultra2 users may want to set OFWCONS_POLL_HZ to a value of '20'.
I have left default value at '4' as higher values can consume a more
than is acceptable amount of CPU, and we don't have a consensus yet
what is an optimal value.

Submitted by:	Pyun YongHyeon <yongari@kt-is.co.kr>
2004-06-24 02:57:11 +00:00
Christian S.J. Peron
d7af790b0d Currently, if the drives specified for volume creation are
not active GEOM providers, it will result in a kernel panic.

If the GEOM provider or disk goes away before the volume
configuration data gets written to the disk, it will result
in another kernel panic.

o Make sure that the drives specified for volume creation
  are active GEOM providers.

o When writing out volume configuration data to associated drives,
  make sure that the GEOM provider is active, otherwise continue
  to the next drive in the volume.

Approved by:	le, bmilekic (mentor)
2004-06-24 02:40:34 +00:00
David E. O'Brien
13a0a973c6 Add casts so all these quantities are a constant type. 2004-06-24 02:24:39 +00:00
David E. O'Brien
328213dac1 Cast variable-sized (based on platform) quantities before printing out. 2004-06-24 02:21:17 +00:00
Robert Watson
a138d21769 In ip_ctloutput(), acquire the inpcb lock around some of the basic
inpcb flag and status updates.
2004-06-24 02:05:47 +00:00
Robert Watson
d67ec3dd48 When asserting non-Giant locks in the network stack, also assert
Giant if debug.mpsafenet=0, as any points that require synchronization
in the SMPng world also required it in the Giant-world:

- inpcb locks (including IPv6)
- inpcbinfo locks (including IPv6)
- dummynet subsystem lock
- ipfw2 subsystem lock
2004-06-24 02:01:48 +00:00
Nate Lawson
30d577a014 Attach the correct handle, not the one that was just deleted. Also,
remove some duplicated code.
2004-06-24 01:57:31 +00:00
Robert Watson
53f9c5e988 Clean up use of ng_hdhasb_mtx a little:
- Assert the mutex in NG_IDHASH_FIND() since the mutex is required to
  safely walk the node lists in the ng_ID_hash table.

- Acquire the ng_nodelist_mtx when walking ng_allnodes or ng_allhooks
  to generate state dump output from the netgraph sysctls.
2004-06-24 01:47:31 +00:00
Robert Watson
ad6b0efff5 Acquire socket lock in the "waiting for connection" loop in
kern_connect(), replacing tsleep() with msleep() with the socket
mutex.
2004-06-24 01:43:23 +00:00
Robert Watson
3f11a2f374 Introduce sbreserve_locked(), which asserts the socket buffer lock on
the socket buffer having its limits adjusted.  sbreserve() now acquires
the lock before calling sbreserve_locked().  In soreserve(), acquire
socket buffer locks across read-modify-writes of socket buffer fields,
and calls into sbreserve/sbrelease; make sure to acquire in keeping
with the socket buffer lock order.  In tcp_mss(), acquire the socket
buffer lock in the calling context so that we have atomic read-modify
-write on buffer sizes.
2004-06-24 01:37:04 +00:00
Robert Watson
adb4cf0fbc Slide socket buffer lock earlier in sopoll() to cover the call into
selrecord(), setting up select and flagging the socker buffers as SB_SEL
and setting up select under the lock.
2004-06-24 00:54:26 +00:00
Nate Lawson
80f0e4c265 Run the power off code directly instead of using indirection through
smp_rendezvous() to ensure we run on the BSP.  This reverts rev 1.128.
Add a comment indicating that MI code should be the one that runs all
shutdown functions on the BSP with the APs halted.  This should work
around problems in power off while waiting for the MI code to be improved.
2004-06-24 00:48:45 +00:00
Robert Watson
1cf30f57e1 Remove spls from portal_open(). Acquire socket lock while sleeping
waiting for the socket to connect and use msleep() on the socket
mute rather than tsleep().  Acquire socket buffer mutexes around
read-modify-write of socket buffer flags.
2004-06-24 00:47:23 +00:00
Nate Lawson
4a03551ddd Use uintmax_t for CPU statistics and add a cast to prevent truncation of
the statistics in a multiply.

Pointed out by:	YONETANI Tomokazu
2004-06-24 00:38:51 +00:00
Lukas Ertl
3a1e11b485 Add a function to clean up RAID5 packets and use it when I/O has
finished or when building the complete packet fails.
2004-06-23 23:52:55 +00:00
Lukas Ertl
c3dba6d0e0 Remove two debugging printfs that are currently rather disturbing
than helpful.
2004-06-23 22:32:01 +00:00
Bosko Milekic
cc822cb53e Make uma_mtx MTX_RECURSE. Here's why:
The general UMA lock is a recursion-allowed lock because
there is a code path where, while we're still configured
to use startup_alloc() for backend page allocations, we
may end up in uma_reclaim() which calls zone_foreach(zone_drain),
which grabs uma_mtx, only to later call into startup_alloc()
because while freeing we needed to allocate a bucket.  Since
startup_alloc() also takes uma_mtx, we need to be able to
recurse on it.

This exact explanation also added as comment above mtx_init().

Trace showing recursion reported by: Peter Holm <peter-at-holm.cc>
2004-06-23 21:59:03 +00:00
Scott Long
bf1c3ddd68 Make the udf_vnops side endian clean. 2004-06-23 21:49:03 +00:00
Paul Saab
76947e3222 Move the sack sysctl's under net.inet.tcp.sack
net.inet.tcp.do_sack -> net.inet.tcp.sack.enable
net.inet.tcp.sackhole_limit -> net.inet.tcp.sack.sackhole_limit

Requested by:	wollman
2004-06-23 21:34:07 +00:00
Lukas Ertl
b950fbe67b Accept "sd len 0" and auto-size the subdisk correctly.
Spotted by: csjp
2004-06-23 21:15:55 +00:00
Paul Saab
6d90faf3d8 Add support for TCP Selective Acknowledgements. The work for this
originated on RELENG_4 and was ported to -CURRENT.

The scoreboarding code was obtained from OpenBSD, and many
of the remaining changes were inspired by OpenBSD, but not
taken directly from there.

You can enable/disable sack using net.inet.tcp.do_sack. You can
also limit the number of sack holes that all senders can have in
the scoreboard with net.inet.tcp.sackhole_limit.

Reviewed by:	gnn
Obtained from:	Yahoo! (Mohan Srinivasan, Jayanth Vijayaraghavan)
2004-06-23 21:04:37 +00:00
Scott Long
89ec2c3c42 First half of making UDF be endian-clean. This addresses the vfsops side. 2004-06-23 19:36:09 +00:00
Roman Kurakin
de98a7eeee Use bus_dma* instead of contigmalloc()+vtophys() for RELENG_5. 2004-06-23 18:13:10 +00:00
John Baldwin
2fc3727323 Finally implement bus_config_intr() support for I/O APIC interrupt sources.
This should fix problems with older SMP systems that only have ISA/EISA
IRQs when routing virgin PCI interrupts as well as on other boxes whose
MADT does not have any interrupt override entries for ISA IRQs that are
used to route PCI interrupts even in APIC mode.
2004-06-23 18:11:33 +00:00