Commit Graph

47575 Commits

Author SHA1 Message Date
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