Commit graph

38948 commits

Author SHA1 Message Date
Ruslan Ermilov ab0f83bd03 Remove bitrot associated with `maxusers'.
Submitted by:	bde
2003-03-22 14:18:23 +00:00
Yaroslav Tykhiy 17ce5b94d6 We shouldn't assert that a vode is locked in vop_lock_post()
if VOP_LOCK() has failed.

Reviewed by:	jeff
2003-03-22 13:21:54 +00:00
Maxime Henrion 0a50de79cb - Add a new ioctl to get the maximum number of ATA channels.
- Use it in atacontrol(8) when listing ATA devices instead of
  stopping at the first ENXIO received.

This makes atacontrol list work on my sparc64 where the two ATA
channels I have are numbered 2 and 3.

Reviewed by:	sos
2003-03-22 12:18:20 +00:00
Maxime Henrion aecfcdb824 Use __packed instead of __attribute__((__packed__)). 2003-03-22 00:25:14 +00:00
Poul-Henning Kamp 7da1ebfd74 Mitigate deadlock situation pending a more complete solution. 2003-03-21 22:05:33 +00:00
Ruslan Ermilov 7f18da65a4 Added missing dependency on rc4.
Reviewed by:	imp
2003-03-21 22:02:58 +00:00
John Baldwin a3f76a6394 Fix some memory leaks in the failure cases after trying to look up the
OSF/1 runtime loader.  Also, use td_ucred instead of p_ucred.

Tested by:	gallatin
Reviewed by:	rwatson
2003-03-21 21:49:52 +00:00
Prafulla Deuskar 55cbc7f8bd Added support for 82541 and 82547 based adapters.
- These have Intel gigabit PHY
 - 82547 uses CSA interface

MFC after:	1 week
2003-03-21 21:47:31 +00:00
John Baldwin 43cf129c99 Sync up linux and svr compat elf fixup functions for exec(). These
functions are now all basically identical except that alpha linux uses
Elf64 arguments and svr4 and i386 linux use Elf32.  The fixups include
changing the first argument to be a register_t ** to match the prototype
for fixup functions, asserting that the process in the image_params struct
is always curproc and removing unnecessary locking to read credentials as a
result, and a few style fixes.
2003-03-21 19:49:34 +00:00
Matthew N. Dodd 868d8b6286 - Use if_broadcastaddr from struct ifnet rather than relying on
extern 'etherbroadcastaddr'.
- Make 'etherbroadcastaddr' static.

Reviewed by:	 imp
2003-03-21 17:53:16 +00:00
Matthew N. Dodd 57842a38fd Add a sysctl node allowing the specification of an address mask to use
when replying to ICMP Address Mask Request packets.
2003-03-21 15:43:06 +00:00
Matthew N. Dodd 21150298bb Add comments regarding the ICMP timestamp fields. 2003-03-21 15:28:10 +00:00
Matthew N. Dodd d79bf33783 Assignment could be NULL, check. 2003-03-21 15:13:29 +00:00
Tim J. Robbins 9ba703c024 Map VAPPEND to VWRITE in nfsspec_access() - VAPPEND is never set in the
mode returned by VOP_GETATTR. This fixes incorrect "Permission denied"
errors when trying to append to a file on an NFSv2 mount.
2003-03-21 05:13:23 +00:00
John Baldwin 31566c96f4 Use td->td_ucred instead of td->td_proc->p_ucred. 2003-03-20 21:17:40 +00:00
John Baldwin 2a53bfbe62 Minor fixes to ffs_fserr():
- Assume that curthread is not NULL.  It never is in -current.
- Use td_ucred instead of p_ucred.
2003-03-20 21:15:54 +00:00
John Baldwin b254666064 Use td_ucred of curthread instead of p_ucred of curproc. This required
changing sem_perm() and sem_hasopen() to take a thread instead of a proc
for the first argument.
2003-03-20 21:12:31 +00:00
David Malone 0036341d93 Extend CPU_ATHLON_SSE_HACK to cover a few more revisions of Athlon CPUs.
Submitted by: Jon Kuster <kwsn@earthlink.net>
MFC after:    2 weeks
2003-03-20 20:50:22 +00:00
Orion Hodson 600f6cbaa2 Distinguish between register sets that depend on ac97 caps (wr0, wr1,
msgd) and those that don't (dxs0-3) when reporting format caps.
2003-03-20 20:07:18 +00:00
Maxime Henrion fd1b2ab0c9 Use atomic operations to increment and decrement the refcount
in busdma tags.  There are currently no tags shared accross
different drivers so this isn't needed at the moment, but it
will be required when we'll have a proper newbus method to get
the parent busdma tag.
2003-03-20 19:45:26 +00:00
Orion Hodson 9963235abc Correct vendor id for ALC101. 2003-03-20 18:17:39 +00:00
Poul-Henning Kamp cc34e37e5b Backout the getcwd changes, a more comprehensive effort will be needed. 2003-03-20 10:40:45 +00:00
Peter Grehan a29355a07b Enable the FPU on first use per-thread and save state across context
switches. Not as lazy as it could be. Changing FPU state with sigcontext
still TODO.

fpu.c - convert some asm to inline C, and macroize fpu loads/stores
swtch.S - call out to save/restore fpu routines
trap.c - always call enable_fpu, since this shouldn't be called once
         the FPU has been enabled for a thread
genassym.c - define for pcb fpu flag
2003-03-20 10:28:20 +00:00
Peter Grehan 0b86d93fe6 - Add PCI ID for Paddington i/o controller, used in old G3's
- Add ID for the Intrepid i/o controller, used in new 12"/17" PowerBooks
- put IDs in chronological order
2003-03-20 10:18:01 +00:00
Mike Barcroft 809484cd89 Update some more namespaces (forgotten in the previous revision). 2003-03-19 15:20:02 +00:00
Peter Grehan 9b6595a08d Add machine check handler. While generally useful, it's required when
issuing PCI config cycles on MPC106-based PowerMacs, which cause machine
checks when accessing non-existent/empty slots.
2003-03-19 08:33:21 +00:00
Hidetoshi Shimokawa 58089a20d1 Clear channel and tag bits before set them.
This should fix the problem that if_fwe doesn't work after DV receiving.
2003-03-19 07:04:11 +00:00
Jake Burkholder 00aabd830d - Remove unused cache flushing routines. These will not necessary work
on future UltraSPARC cpus for which the data cache is not direct mapped.
- Move UltraSPARC I and II (spitfire, blackbird, sapphire, sabre) specific
  functions to spitfire.c, and add cheetah.c for UltraSPARC III specific
  functions.  Initially just cache flushing, but there are a few other
  functions that will need to move here.
- Add an ipi handler for data cache flushing on UltraSPARC III.
- Use function pointers to select the right cache flushing functions based
  on cpu_impl.

With this it is possible to boot single user from an mfs root on UltraSPARC
III systems, including spinning up secondary processors.  There is currently
no support for the host to pci bridge, and no documentation for it is
publically available.

Thanks to Oleg Derevenetz for providing access to a system with UltraSPARC
III+ cpus.
2003-03-19 06:55:37 +00:00
Jake Burkholder 2b8cd5a6a2 - Set cpu_impl early in sparc64_init so that we can use it to detect
UltraSPARC III and higher cpus and do needed setup.
- Disable the "system tick" interrupt for UltraSPARC III.  This avoids
  an interrupt storm on startup since we're not prepared for these at
  all.  This feature has questionable use anyway.
- Clear tick on startup and then leave it alone.
2003-03-19 05:51:21 +00:00
David Xu 6ce75196ce Adjust code for userland preemptive. Userland can set a quantum in
kse_mailbox to schedule an upcall, this is useful for userland timeout
routine, for example pthread_cond_timedwait().

Also extract upcall scheduling code from kse_reassign and create
a new function called thread_switchout to include these code.

Reviewed by: julain
2003-03-19 05:49:38 +00:00
Jake Burkholder 9ff3487981 Remove a workaround for mysterious junk appearing in the tlb of secondary
cpus.  It turned out to be a bug in the loader.
2003-03-19 05:05:08 +00:00
Jake Burkholder 8c4ea08fc7 Implement db_print_backtrace. This may need to flush out the windows
as well.
2003-03-19 02:58:53 +00:00
Mike Silbersack af498ca9eb Make sure to free the correct resources when the card fails to attach
properly.  (Broken in the previous commit.)

Noticed by:	"Niels Chr. Bank-Pedersen" <ncbp@bank-pedersen.dk>
2003-03-19 01:48:14 +00:00
Dag-Erling Smørgrav 830c3153c6 Unregisterize, ansify. 2003-03-19 00:49:40 +00:00
Maxime Henrion dab392a4d4 Remove an empty comment. 2003-03-19 00:34:43 +00:00
Dag-Erling Smørgrav 4e8074eba2 Whitespace cleanup. 2003-03-19 00:33:38 +00:00
Jake Burkholder 84513ca201 long != int. Use SYSCTL_UINT for kern.devstat.generation. Fixes booting
on sparc64.
2003-03-18 23:32:27 +00:00
Maxim Sobolev 2d95f7d4a9 Brucify.
Requested and reviewed by:	bde
MFC after:	2 weeks
2003-03-18 21:26:28 +00:00
Andrew Gallatin daa949b66e Fix a race condition in socow_setup(): The page must be wired before
sf_buf_alloc() is called, as sf_buf_alloc() may sleep.  If it does sleep,
the page might be reclaimed before wiring occurs.

Reported by: alc
2003-03-18 18:27:33 +00:00
MIHIRA Sanpei Yoshiro 1017eea32d Add support for Planex FNW-3800-TX(CardBus 100M/10M).
Submitted by:	Kunihiro Arai <araik@attglobal.net>
Obtained from:	[bsd-nomads:16625]
2003-03-18 14:57:09 +00:00
Poul-Henning Kamp 7e69ddc973 Missed in last commit: don't compile now non-existent geom_stats.c 2003-03-18 09:53:03 +00:00
Poul-Henning Kamp e24cbd9017 Retire the GEOM private statistics code and use devstat instead. 2003-03-18 09:42:33 +00:00
Poul-Henning Kamp c967bee755 If devstat_new_entry() is passed a unit number of -1 assume that
the devstat is for an "interior" GEOM node and register using the
name argument as a geom identity pointer.  Do not put these devstat
structures on the list returned by the sysctl.

This gives us the ability to tell the two kinds of nodes apart and
leave the current "strictly physical" view of devstat intact without
modifications, yet be able to use devstat for both kinds of devices.

It also saves us bloating struct devstat with another 48 bytes of
space for the name.  At least for now.

Reviewed by:    ken
2003-03-18 09:30:31 +00:00
Poul-Henning Kamp 224d5539a9 Make devstat fully Giant agnostic:
Add a mutex and protect the allocation and traversal of the list with it.

When we allocate a page for devstat use we drop the mutex and use
M_WAITOK this is not nice, but under the given circumstances the
best we can do.

In the sysctl handler for returning the devstat entries we do not want to
hold the mutex across copyout(9) calls, so we keep a very careful eye on
the devstat_generation count, and abandon with EBUSY if it changes under
our feet.

Specifically test for BIO_WRITE, rather than default non-read,non-deletes
as write.  Make the default be DEVSTAT_NO_DATA.

Add atomic increments of the sequence[01] fields so applications using the
mmap'ed view stand a chance of detecting updates in progress.

Reviewed by:    ken
2003-03-18 09:20:20 +00:00
Poul-Henning Kamp b4b138c27f Including <sys/stdint.h> is (almost?) universally only to be able to use
%j in printfs, so put a newsted include in <sys/systm.h> where the printf
prototype lives and save everybody else the trouble.
2003-03-18 08:45:25 +00:00
Jake Burkholder eb51ffcb6d Remove unused fields. 2003-03-18 08:15:24 +00:00
Poul-Henning Kamp 538aabaad9 Make devstat_new_entry() take a const void * rather than const char *
argument, GEOM nodes are not identified by ascii string.
2003-03-18 07:52:59 +00:00
Mike Silbersack 16a930f6cb Instead of relying on a compile time define to determine whether the xl
driver should use port or memory based IO, determine it dynamically
at runtime, preferring MMIO where possible.  This helps us support newer
arches which dislike port based access better.

Tested on i386 & sparc64, with 3c900, 905, 905b, and 905C cards.
(in varying combinations by both jake and myself)
2003-03-18 06:29:51 +00:00
Warner Losh 0e630ee24b o Lucent cards don't seem to like multiple buffers for tx. Use only
one tx buffer for these cards.  The old driver only used one.  We use
  1 for symbol, and 3 for prism cards.
o Don't do the maximum loops thing in the ISR.  In fact, revert to the
  old interrupt handler.  Lucent cards don't seem to work too well if
  you don't disable/enable interrupts from the card in the ISR.

Between these two changes, Lucent cards suck less.  They work in
autoselect mode only.  And seem to get 1Mbps or 2Mbps only.  Setting a
specific media speed doesn't work, and I've had a few issues even with
these patches.  They turn a former brick into a nearly useful card.

These patches work on the prism 2 and 2.5 PC Card cards that I have.
I've not tested this on PCI cards.  I suspect, but couldn't find
proof, that they were the reason that the ISR was changed so radically
from its FreeBSD roots in NetBSD.  We might need to have a variant ISR
if so.
2003-03-18 04:22:42 +00:00
Warner Losh 572ab50c54 Move symbol reset detection code back into wi_reset. This is a more
reliable way to detect if the symbol cards have been reset or not.
This makes symbol cards work better.

Submitted by: deischen
2003-03-18 02:54:39 +00:00
Warner Losh 08d49adb7f Add DLINK DWL650H
From NetBSD by way of deischen
2003-03-18 02:47:53 +00:00
Warner Losh 7a073cc3e0 Add SMC 2602W pci card, from a post to mobile@ 2003-03-18 02:45:29 +00:00
Warner Losh b43a533ddb Use %jd and a cast to intmax_t instead of a cast to long.
Minor style nit while I'm here.
2003-03-18 02:40:40 +00:00
Warner Losh ec72163b64 Tag longling_addr as maybe using a bad type, I'm not sure. 2003-03-18 02:38:33 +00:00
Warner Losh 1831679c41 Regenerate for 1.45 2003-03-18 02:37:25 +00:00
Warner Losh 2a72cb5210 Add DLINK DWL650H
From NetBSD by way of deichen
2003-03-18 02:36:54 +00:00
John Baldwin a480c73063 Expand the APIC ID mask field of the ICR register to 8 bits intead of just
4 bits.  This reportedly fixes booting on the SW7500CW2.  Much thanks to
the submitter for tracking this down!

Submitted by:	Brian Buchanan <brian@ncircle.com>
Reviewed by:	peter
MFC after:	3 days
2003-03-17 19:14:13 +00:00
Jake Burkholder 56a6b03a6d Clean up /dev/mem now that pmap handles illegal aliases properly. Don't
allow access to device memory through /dev/mem, or try to make modifying
kernel text through /dev/mem safe (it is not).
2003-03-17 18:53:02 +00:00
Jeff Roberson 5d952c1b59 - Unlock the target bp and not the pager buf bp in a failure case in
cluster_wbuild().  This was causing strange panics that were widely
   reported on current@.

Big Pointy Hat to:	jeff
2003-03-17 18:38:49 +00:00
Maxime Henrion cab2362883 - Lock down the bounce pages structures. We use the same locking scheme
as with the alpha backend because both implementations of bounce pages
  are identical.
- Remove useless splhigh()/splx() calls.
2003-03-17 18:34:34 +00:00
Maxime Henrion 379711437f Tidy up the locking of the bounce pages structures.
- Use SYSINIT to initialize the structures instead of checking
  total_bpages against 0 in alloc_bounce_pages(), which could lead
  to several initializations being done at the same time.
- Add missing locking in bus_dmamap_load(), the bounce pages mutex
  must be held when calling reserve_bounce_pages() and when touching
  the bounce_map_waitinglist list.
- Remove the useless splhigh() and splx() calls.
- Assert that the bounce pages mutex is held in reserve_bounce_pages()
  to catch regressions.
2003-03-17 17:26:39 +00:00
Warner Losh fabc845e37 Remove bogus KASSERT. The 802.11 layer and the resume from suspend
code both seem to call wi_start (directly or via the if_start pointer)
without checking to see if OACTIVE is 0.  In addition, I think that
with the use of 3 transmit buffers this routine can be called with
OACTIVE set, but I might be mistaken about that (and it doesn't
matter).

Reviewed by: sam
Noticed by: imp, alfred, ambrisko
2003-03-17 13:19:28 +00:00
Poul-Henning Kamp 9eaf5abceb (This commit certainly increases the need for a wash&clean of vfs_cache.c,
but I decided that it was important for this patch to not bit-rot, and
since it is mainly moving code around, the total amount of entropy is
epsilon /phk)

This is a patch to move the common parts of linux_getcwd() back into
kern/vfs_cache.c so that the standard FreeBSD libc getcwd() can use it's
extended functionality.  The linux syscall linux_getcwd() in
compat/linux/linux_getcwd.c has been rewritten to use it too.  It should
be possible to simplify libc's getcwd() after this.  No doubt this code
needs some cleaning up, since I've left in the sysctl variables I used
for debugging.

PR:	48169
Submitted by:	James Whitwell <abacau@yahoo.com.au>
2003-03-17 12:21:08 +00:00
Poul-Henning Kamp ddcceb7e08 Fix malloc() without legal mode flag. 2003-03-17 07:28:01 +00:00
Poul-Henning Kamp 8595de4aec Fix a malloc() with no legal modeflag. 2003-03-17 07:26:25 +00:00
Jake Burkholder b17d5f7dda Ensure that kstack0 has physical colour equal to virtual colour, so that
illegal aliases will not be created in the data cache if its accessed
through another such mapping.
2003-03-17 03:18:56 +00:00
Jake Burkholder 9f77ba59c5 Subtract the memory that backs the vm_page structures from phys_avail
after mapping it.  This makes it possible to determine if a physical
page has a backing vm_page or not.
2003-03-17 03:16:00 +00:00
Poul-Henning Kamp 5fa5746d3d Add a #define for the device name of the mmap device for devstat.
Constify the geom identification pointer.
2003-03-16 23:20:05 +00:00
Poul-Henning Kamp 20d2026b4e #ifdef notyet a bit of code which needs not yet committed refcounting to
work correctly.
2003-03-16 16:29:04 +00:00
Søren Schmidt 92737d1739 Fix the cable detection and properly find the host bridge on
older SiS chips.
2003-03-16 16:26:51 +00:00
Tim J. Robbins bf6ac110e0 Make udf_allocv() return an unlocked vnode instead of a locked one
to avoid a "locking against myself" panic when udf_hashins() tries
to lock it again. Lock the vnode in udf_hashins() before adding it to
the hash bucket.
2003-03-16 11:19:54 +00:00
Alan Cox 42de97a50a Pass the sf buf to MEXTADD() as the optional argument. This permits
the simplification of socow_iodone() and sf_buf_free(); they don't
have to reverse engineer the sf buf from the data's address.
2003-03-16 07:19:12 +00:00
Jake Burkholder 5501d40bb9 Made the prototypes for pmap_kenter and pmap_kremove MD. These functions
are machine dependent because they are not required to update the tlb when
mappings are added or removed, and doing so is machine dependent.
In addition, an implementation may require that pages mapped with pmap_kenter
have a backing vm_page_t, which is not necessarily true of all physical
pages, and so may choose to pass the vm_page_t to pmap_kenter instead of the
physical address in order to make this requirement clear.
2003-03-16 04:16:03 +00:00
Matthew N. Dodd fae930213c Catch up with bpf_mtap() changes. 2003-03-16 00:30:02 +00:00
Matthew N. Dodd 2d6bcb381e Catch up with recent infrastructure changes. 2003-03-16 00:24:18 +00:00
Matthew N. Dodd 04b269f5fe - Use IFP2AC().
- Support IFF_MONITOR.
- Borrow some consistency for if_input() routines from if_ethersubr.c.
- Correct comments regarding fddi_input() that no longer apply.
2003-03-16 00:17:44 +00:00
Jake Burkholder d647b74e54 Implement is_physical_memory. Accessing memory which doesn't exist causes
traps that are difficult to recover from, so we check against the memory
map returned by the prom.
2003-03-15 23:59:00 +00:00
Matthew N. Dodd 8b247b5adc Fix whitespace issues. 2003-03-15 23:55:33 +00:00
Matthew N. Dodd 669404e48e Register module dependencies. 2003-03-15 23:26:41 +00:00
Matthew N. Dodd 2152ccaa64 Don't build if_iso88025subr.c into the oltr module. 2003-03-15 23:24:17 +00:00
Matthew N. Dodd c8fa3105ce G/C unused varilable. 2003-03-15 23:21:32 +00:00
Matthew N. Dodd 326231bc52 Catch up with recent changes. 2003-03-15 23:20:10 +00:00
Matthew N. Dodd 2690d49437 Bump __FreeBSD_version for token-ring changes. 2003-03-15 23:10:05 +00:00
Matthew N. Dodd ac46f4fce3 Don't strip header from packets before input routine is called. 2003-03-15 23:08:40 +00:00
Matthew N. Dodd 59d776b808 Use if_printf(). 2003-03-15 23:02:36 +00:00
Matthew N. Dodd 089b2f2ead iso88025_ifattach() changes:
- Call if_attach().
- Conditionally call bpfattach() based on second function argument.
2003-03-15 22:52:23 +00:00
Matthew N. Dodd 69ed274634 - Style(9) changes.
- Remove unneeded assignment.
- Increment if_oerrors as per if_fddisubr.c.
- Wrap ISO code with conditional.
2003-03-15 22:37:11 +00:00
Matthew N. Dodd 94b3e4d32f Stray } forgotten by manual merging. 2003-03-15 22:28:51 +00:00
Matthew N. Dodd bd3e6bb8b8 - Remove stray ).
- Add missing breaks.
- Add missing if_noproto++.
2003-03-15 22:25:06 +00:00
Poul-Henning Kamp d15cd51001 One devstat_start_transaction_bio() is enough. 2003-03-15 22:20:38 +00:00
Matthew N. Dodd 0e96758da8 Revert part of 1.37; use bcopy() like if_fddisubr.c. 2003-03-15 22:09:29 +00:00
Matthew N. Dodd 2910fe6d37 - Increment ifp->if_noproto when appropriate.
- Use 'goto dropanyway' when appropriate.
- Move dropanyway label out of switch for readability.
2003-03-15 21:59:11 +00:00
Poul-Henning Kamp 7194d335cf Run a revision of the devstat interface:
Kernel:

Change statistics to use the *uptime() timescale (ie: relative to
boottime) rather than the UTC aligned timescale.  This makes the
device statistics code oblivious to clock steps.

Change timestamps to bintime format, they are cheaper.

Remove the "busy_count", and replace it with two counter fields:
"start_count" and "end_count", which are updated in the down and
up paths respectively.  This removes the locking constraint on
devstat.

Add a timestamp argument to devstat_start_transaction(), this will
normally be a timestamp set by the *_bio() function in bp->bio_t0.
Use this field to calculate duration of I/O operations.

Add two timestamp arguments to devstat_end_transaction(), one is
the current time, a NULL pointer means "take timestamp yourself",
the other is the timestamp of when this transaction started (see
above).

Change calculation of busy_time to operate on "the salami principle":
Only when we are idle, which we can determine by the start+end
counts being identical, do we update the "busy_from" field in the
down path.  In the up path we accumulate the timeslice in busy_time
and update busy_from.

Change the byte_* and num_* fields into two arrays: bytes[] and
operations[].

Userland:

Change the misleading "busy_time" name to be called "snap_time" and
make the time long double since that is what most users need anyway,
fill it using clock_gettime(CLOCK_MONOTONIC) to put it on the same
timescale as the kernel fields.

Change devstat_compute_etime() to operate on struct bintime.

Remove the version 2 legacy interface: the change to bintime makes
compatibility far too expensive.

Fix a bug in systat's "vm" page where boot relative busy times would
be bogus.

Bump __FreeBSD_version to 500107

Review & Collaboration by:	ken
2003-03-15 21:59:06 +00:00
Matthew N. Dodd 0c61d694a8 Update interface statistics after MAC and IFF_UP|IFF_RUNNING checks. 2003-03-15 21:51:39 +00:00
Matthew N. Dodd f156dd7b68 - Adopt tests for (IFF_UP|IFF_RUNNING) and non local unicast packets
in promiscuous mode from if_fddisubr.c.
- Add comment to reduce diffs.
2003-03-15 21:42:19 +00:00
Matthew N. Dodd 9a3c9f3971 Add MAC support.
This is the same code that was added in 1.70 of if_fddisubr.c
2003-03-15 21:30:00 +00:00
Matthew N. Dodd 15eccea260 Use llc_control rather than llc_snap.control. 2003-03-15 20:35:19 +00:00
Matthew N. Dodd ad20d0f577 - Add comment.
- Whitespace fixes.
2003-03-15 20:33:30 +00:00
Matthew N. Dodd 06f684b004 Reduce code differences. 2003-03-15 19:37:44 +00:00
Matthew N. Dodd a93a116153 Use ISO88025_ADDR_LEN where appropriate. 2003-03-15 19:25:00 +00:00
Matthew N. Dodd dbd05f2e56 Don't use etherbroadcastaddr; use iso88025_broadcastaddr. 2003-03-15 19:16:39 +00:00
Matthew N. Dodd fd87fbf6b8 - Remove definition of senderr() from iso88025.h.
- Use definition of senderr() from if_ethersubr.c.
2003-03-15 19:10:19 +00:00
Maxim Sobolev 71fbba351a Remove duplicate line introduced in the previous commit.
Submitted by:	bde
MFC after:	2 weeks
2003-03-15 18:49:41 +00:00
Matthew N. Dodd 386dca02cb Some whitespace/style/readability changes. 2003-03-15 17:54:49 +00:00
Matthew N. Dodd 7c16bd3a8b Add iso88025_resolvemulti().
Cribbed from net/if_fddisubr.c
2003-03-15 16:49:08 +00:00
Matthew N. Dodd bf54cb290a Fix formatting of iso88025_ifattach(). 2003-03-15 16:41:35 +00:00
Matthew N. Dodd fe7e109c6f Re-order and prune includes. 2003-03-15 16:37:28 +00:00
Maxim Sobolev 084254f807 - Add minimal support for TI16754 4xUART chip into sio(4) driver and remove
now unnecessary hack from the previous commit;
- Add support for Interrupt Latch Register (ILR) into puc(4). So far only
  ILRs compatible with specifications from Digi International are supported.
  Support for other types of ILRs could be easily added later;
- Correct clock frequency for IC Book Labs Dreadnought x16 Lite board;
- Enable ILR detection/usage for IC Book Labs Dreadnought x16 boards.

Sponsored by:   IC Book Labs
MFC after:      2 weeks
2003-03-15 16:25:40 +00:00
Matthew N. Dodd 40811c1473 Add module data and version. 2003-03-15 15:38:02 +00:00
Matthew N. Dodd 4fd80d5b9d s/llc_un.type_snap/llc_snap/g 2003-03-15 15:35:25 +00:00
Matthew N. Dodd 67df65de97 Formatting and whitespace changes. 2003-03-15 15:09:11 +00:00
Takanori Watanabe 869c12cbb4 Add module dependency. This makes udbp.ko to be loaded. 2003-03-15 13:03:30 +00:00
Poul-Henning Kamp fe002e7546 Fix a bug I introduced by overlooking the fact that "unit number" can
be one of several things in this driver.

Spotted & Tested by:	alfred
2003-03-15 12:16:33 +00:00
Poul-Henning Kamp 0be3115328 Don't use the devstat->busy_count for state decisions in the device
drivers.  Doing so imposes atomicity and locking constraints on the
devstat API.

By:	ken
2003-03-15 11:00:56 +00:00
Poul-Henning Kamp 09a6b2aad6 Call devstat_start_transaction_bio() instead of devstat_start_transaction(). 2003-03-15 10:56:19 +00:00
Poul-Henning Kamp 1ecc485c1b Call devstat_start_transaction_bio() instead of devstat_start_transaction() 2003-03-15 10:50:44 +00:00
Poul-Henning Kamp 81876757ec Use devstat_{start,end}_transaction_bio().
Remember to set bio_resid correctly first.
2003-03-15 10:49:26 +00:00
Poul-Henning Kamp 9fa85de269 Add a devstat_start_transaction_bio() to match the
devstat_end_transaction_bio() we already have.

For now it just calls devstat_start_transaction(), but that will change
shortly.
2003-03-15 10:33:32 +00:00
Crist J. Clark 010dabb047 Add a 'verrevpath' option that verifies the interface that a packet
comes in on is the same interface that we would route out of to get to
the packet's source address. Essentially automates an anti-spoofing
check using the information in the routing table.

Experimental. The usage and rule format for the feature may still be
subject to change.
2003-03-15 01:13:00 +00:00
Mike Barcroft 13141dbc38 Add missing types, update standard namespaces, and use variable types
that don't require <sys/types.h>.
2003-03-14 16:09:48 +00:00
Maxime Henrion 40b63da2a9 Bah, get it right this time and add sys/lock.h before sys/mutex.h. 2003-03-14 13:30:31 +00:00
Jake Burkholder 7b66da6e32 lock.h must be included before mutex.h. 2003-03-14 07:19:29 +00:00
Jeff Roberson 8501ead911 - Add a forgotten BUF_LOCK()
Most sincere apologies to:	jake
2003-03-14 05:13:19 +00:00
David Xu 9a4b78c9da Export current time when returning from never blocked syscall. 2003-03-14 03:52:16 +00:00
Maxime Henrion 7541142438 Oops, add missing includes. Pass me the pointy hat.
Reported by:	jake
2003-03-14 00:04:37 +00:00
John Baldwin 2d055ab20f Trim some trailing whitespace. 2003-03-13 23:07:09 +00:00
Scott Long 6f420b1756 Now that bus_dmamem_alloc() handles its Giant mutex requirements itself,
don't bother doing the same in the code that calls it.
2003-03-13 22:56:11 +00:00
John Baldwin b62f75cf44 - Change the linux_[gs]et_os{name, release, s_version}() functions to
take a thread instead of a proc for their first argument.
- Add a mutex to protect the system-wide Linux osname, osrelease, and
  oss_version variables.
- Change linux_get_prison() to take a thread instead of a proc for its
  first argument and to use td_ucred rather than p_ucred.  This is ok
  because a thread's prison does not change even though it's ucred might.
- Also, change linux_get_prison() to return a struct prison * instead of
  a struct linux_prison * since it returns with the struct prison locked
  and this makes it easier to safely unlock the prison when we are done
  messing with it.
2003-03-13 22:45:43 +00:00
John Baldwin 75768576cc Add a new userland-visible ktrace flag KTR_DROP and an internal ktrace flag
KTRFAC_DROP to track instances when ktrace events are dropped due to the
request pool being exhausted.  When a thread tries to post a ktrace event
and is unable to due to no available ktrace request objects, it sets
KTRFAC_DROP in its process' p_traceflag field.  The next trace event to
successfully post from that process will set the KTR_DROP flag in the
header of the request going out and clear KTRFAC_DROP.

The KTR_DROP flag is the high bit in the type field of the ktr_header
structure.  Older kdump binaries will simply complain about an unknown type
when seeing an entry with KTR_DROP set.  Note that KTR_DROP being set on a
record in a ktrace file does not tell you anything except that at least one
event from this process was dropped prior to this event.  The user has no
way of knowing what types of events were dropped nor how many were dropped.

Requested by:	phk
2003-03-13 18:31:15 +00:00
John Baldwin a5881ea55a - Cache a reference to the credential of the thread that starts a ktrace in
struct proc as p_tracecred alongside the current cache of the vnode in
  p_tracep.  This credential is then used for all later ktrace operations on
  this file rather than using the credential of the current thread at the
  time of each ktrace event.
- Now that we have multiple ktrace-related items in struct proc that are
  pointers, rename p_tracep to p_tracevp to make it less ambiguous.

Requested by:	rwatson (1)
2003-03-13 18:24:22 +00:00
Maxime Henrion c0796d1cb4 Grab Giant around calls to contigmalloc() and contigfree() so
that drivers converted to be MP safe don't have to deal with it.
2003-03-13 17:18:48 +00:00
Maxime Henrion ea458bbcdb Memory allocated with contigmalloc() should be freed with
contigfree(), not with free().
2003-03-13 17:10:54 +00:00
Hartmut Brandt 57648f8aae This corrects a longstanding endian bug in processing LLC/SNAP encoded
frames. A comment in if_atm.h suggests that both macros, that for extracting
the ethertype and that for inserting it, handle their argument in host
byte order. In fact, the inserting macro treated its argument as an opposite
host order short and the calling code feeds it the result of htons(). This
happens to work on i386, but fails on sparc. Make the macro use real host
endianess.

Reviewed by:	kjc, atm@
2003-03-13 12:44:06 +00:00
Jeffrey Hsu 7792ea2700 Greatly simplify the unlocking logic by holding the TCP protocol lock until
after FIN_WAIT_2 processing.

Helped with debugging:	Doug Barton
2003-03-13 11:46:57 +00:00
Søren Schmidt f711eff1d2 Remove the check for more than one open if one is a write op.
This allows using DVD+RW and DVD-RW as random storage, provided
the 32K blocksize is honoured for DVD-RW (DVD+RW has built in
read-modify-write).
2003-03-13 09:12:17 +00:00
Søren Schmidt 6918962fad Dont free the stats struct, this has been changed by the new stat code.
Spotted by: Ian Dowse <iedowse@maths.tcd.ie>
2003-03-13 09:09:10 +00:00
Søren Schmidt 394046e66f Dont call dma->free unless dma is there.
Spotted by: Ian Dowse <iedowse@maths.tcd.ie>
2003-03-13 09:04:55 +00:00
Ian Dowse a80cc4e104 In m_dup_pkthdr(), convert the supplied `how' argument into malloc
flags when passing it into m_tag_copy_chain(), as m_tag* functions
use malloc, not mbuf flags.
2003-03-13 09:02:19 +00:00
Søren Schmidt 64eca1e1f2 Add pci id# for the sis648 2003-03-13 07:55:53 +00:00
Jeff Roberson 749ffa4ecd - Add a lock for protecting against msleep(bp, ...) wakeup(bp) races.
- Create a new function bdone() which sets B_DONE and calls wakup(bp). This
   is suitable for use as b_iodone for buf consumers who are not going
   through the buf cache.
 - Create a new function bwait() which waits for the buf to be done at a set
   priority and with a specific wmesg.
 - Replace several cases where the above functionality was implemented
   without locking with the new functions.
2003-03-13 07:31:45 +00:00
Jeff Roberson e99215a614 - Remove a dead check for bp->b_vp == vp in vtruncbuf(). This has not been
possible for some time.
 - Lock the buf before accessing fields.  This should very rarely be locked.
 - Assert that B_DELWRI is set after we acquire the buf.  This should always
   be the case now.
2003-03-13 07:22:53 +00:00
Jeff Roberson 09f11da5a3 - Remove a race between fsync like functions and flushbufqueues() by
requiring locked bufs in vfs_bio_awrite().  Previously the buf could
   have been written out by fsync before we acquired the buf lock if it
   weren't for giant.  The cluster_wbuild() handles this race properly but
   the single write at the end of vfs_bio_awrite() would not.
 - Modify flushbufqueues() so there is only one copy of the loop.  Pass a
   parameter in that says whether or not we should sync bufs with deps.
 - Call flushbufqueues() a second time and then break if we couldn't find
   any bufs without deps.
2003-03-13 07:19:23 +00:00
Jeff Roberson f5f0dee483 - Lock the buf before clearing flags. 2003-03-13 07:07:16 +00:00
Jeff Roberson c033bdc013 - Lock bufs before inspecting their flags. 2003-03-13 07:05:22 +00:00
Jeff Roberson 619bddc702 - Lock the buf before inspecting its contents. 2003-03-13 07:04:11 +00:00
Alfred Perlstein 569d3c4bf0 Make sure we actually have a dev before dereferencing in case someone
botches and sends us a NULL pointer.  The other code in this file seems
to expect it to be able to handle it behaving this way.
2003-03-13 06:29:44 +00:00
Jeff Roberson de950c003c - Tune down read_max. For single disks we get no gain out of reading more
than a MAXPHYS size block ahead.  Having this set too high just leaves
   other processes starved for IO and screws up interactive response.  Let the
   users with RAID set it higher when they need it.
2003-03-13 06:17:59 +00:00
Jeffrey Hsu da3a8a1a4f Add support for RFC 3390, which allows for a variable-sized
initial congestion window.
2003-03-13 01:43:45 +00:00
Tim J. Robbins 6ec62361c8 Tidy up previous change: move comment about obtaining an exclusive
reference where it belongs, and remove a blank line to make it more
obvious what the comment applies to.
2003-03-13 00:57:47 +00:00
Tim J. Robbins 262c27b846 Back out previous. The locking here needs a rethink. 2003-03-13 00:54:53 +00:00
Maxime Henrion f3b8b63b15 Pass the correct malloc flags to m_tag_alloc(). 2003-03-13 00:30:31 +00:00
David Schultz 72d97679ff - When the VM daemon is out of swap space and looking for a
process to kill, don't block on a map lock while holding the
  process lock.  Instead, skip processes whose map locks are held
  and find something else to kill.
- Add vm_map_trylock_read() to support the above.

Reviewed by:	alc, mike (mentor)
2003-03-12 23:13:16 +00:00
Jeffrey Hsu 582a954b00 Implement the Limited Transmit algorithm (RFC 3042). 2003-03-12 20:27:28 +00:00
John Baldwin 8510f2a833 - Various little style fixes.
- If SYSCTL_OUT() fails in sysctl_kern_proc_args(), return the error
  instead of ignoring it if we have new arguments for the process.
- If the new arguments for a process are too long, return ENOMEM instead of
  returning success but not doing the actual copy.

Submitted by:	bde
2003-03-12 20:17:40 +00:00
Maxim Sobolev 525e5ed929 Correct clock frequency for the IC Book Labs' cards, so that it's possible
to use speeds higher than 115200.

Sponsored by:	IC Book Labs
MFC after:	2 weeks
2003-03-12 17:56:03 +00:00
Maxim Sobolev a2a101e766 Add initial support for IC Book Labs Dreadnought x16 Pro 16-ports card. Since
this card is based on 16750 UART, modify sio(4) a bit to ignore 16750-specific
7th bit of MCR when probing card. This allows card to be detected and attached
as 16550A-compatible device. More work needs to be done in order to enable
nice 16750-specific features such as larger fifo buffer and higher speeds.

Sponsored by:	IC Book Labs
MFC after:	2 weeks
2003-03-12 17:20:24 +00:00
John Baldwin 4bc6471b53 - Avoid dropping the proc lock around a simple permissions check and just
hold hold it across the check to avoid extra lock operations in the
  common case.
- Copy in the new args to a temporary pargs structure before we drop the
  reference to the old one.  Thus, if the copyin() fails, the process
  arguments are unchanged rather than being deleted.  Also, p_args is no
  longer NULL during the sysctl operation.
2003-03-12 16:14:55 +00:00
Søren Schmidt deff57d72c Correct the last commit, only look for subfunctions on the same PCI slot. 2003-03-12 15:45:52 +00:00
Orion Hodson b2a0f525e6 Correct CS4205 base vendor id.
Reported by:    Christophe Juniet and Mark Santcroos.
2003-03-12 15:11:25 +00:00
Sam Leffler 4a692a1fc2 correct two more flag misuses; m_tag* use malloc flags 2003-03-12 14:45:22 +00:00
Ruslan Ermilov 99bca5069e Simplify the assignment statement. 2003-03-12 14:32:46 +00:00
Søren Schmidt 5b24125046 Cleanup the probe code a bit. 2003-03-12 12:05:17 +00:00
Tim J. Robbins a7cbe87a5e Acquire sched_lock around use of FOREACH_KSEGRP_IN_PROC, accesses
to kg_nice and calls to sched_nice() in getpriority() and setpriority()
(really donice()).
2003-03-12 11:24:41 +00:00
Tim J. Robbins 3890793e9c In wait1(), remove the zombie process from zombproc before removing
it from its pgrp to avoid leaving zombies around with p_pgrp == NULL.
This bug was apparent as a NULL-dereference in the pid selection code
in fork1().
2003-03-12 11:10:04 +00:00
Søren Schmidt 9eb8572ea2 Dont hang the channel on enclosures without sensors. 2003-03-12 10:59:35 +00:00
Hidetoshi Shimokawa d067ce208d Put back including sys/devicestat.h for 4-stable. 2003-03-12 10:36:53 +00:00
Kenjiro Cho fec4b7015e clean up the en driver since it will survice for a while by
Harti Brandt's effort.
remove the DMA test to detect problems of the first generation PCI chipsets
back in 1998.
it is no longer needed and has been the source of the false alarm that
the driver uses too much stack space.
2003-03-12 10:28:26 +00:00
Jake Burkholder 4d3f408cee - Added support for multiple page directory pages to pmap_pinit and
pmap_release.
- Merged pmap_release and pmap_release_free_page.  When pmap_release is
  called only the page directory page(s) can be left in the pmap pte object,
  since all page table pages will have been freed by pmap_remove_pages and
  pmap_remove.  In addition, there can only be one reference to the pmap and
  the page directory is wired, so the page(s) can never be busy.  So all there
  is to do is clear the magic mappings from the page directory and free the
  page(s).

Sponsored by:	DARPA, Network Associates Laboratories
2003-03-12 07:38:37 +00:00
Sam Leffler 9adc8e4d75 correct malloc flag argument
Reported by:	Kris Kennaway <kris@obsecurity.org>
2003-03-12 06:08:48 +00:00
Alexander Kabaev 46300030ec Do not depend on namespace pollution, explicitly include sys/sx.h 2003-03-12 02:55:20 +00:00
Sam Leffler 98822e3945 fix module building; drivers now require opt_{ubsec,hifn}.h 2003-03-11 23:20:43 +00:00
Sam Leffler cff5befbba FIPS 140-2 rng data tester for h/w crypto devices. This driver periodically
monitors the entropy data harvested by crypto drivers to verify it complies
with FIPS 140-2.  If data fails any test then the driver discards it and
commences continuous testing of harvested data until it is deemed ok.
Results are collected in a statistics block and, optionally, reported on
the console.  In normal use the overhead associated with this driver is
not noticeable.

Note that drivers must (currently) be compiled specially to enable use.

Obtained from:	original code by Jason L. Wright
2003-03-11 22:54:44 +00:00
Sam Leffler b7c4858f1e o add crypto driver glue for using the new rndtest driver/module; this is
conditional in each driver on foo_RNDTEST being defined_
o bring HIFN_DEBUG and UBSEC_DEBUG out to be visible options; they control
  the debugging printfs that are set with hw.foo.debug (e.g. hw.hifn.debug)
2003-03-11 22:47:06 +00:00
John Baldwin 2ca9461a05 Trim an extra blank line that snuck into the last commit. 2003-03-11 22:33:42 +00:00
Sam Leffler bd17515b68 gack; revert previous commit; not only did I read things backward but
I was in the wrong tree
2003-03-11 22:23:19 +00:00
Sam Leffler 44cc7634a3 sync with current: reduce default maxbatch setting from 5 to 1
Reviewed by:	re (sort of, consider this part of my previous request)
2003-03-11 22:20:43 +00:00
Alexander Kabaev c162e9c2eb Rename vfs_stdsync function to vfs_stdnosync which matches more
closely what function is really doing. Update all existing consumers
to use the new name.

Introduce a new vfs_stdsync function, which iterates over mount
point's vnodes and call FSYNC on each one of them in turn.

Make nwfs and smbfs use this new function instead of rolling their
own identical sync implementations.

Reviewed by:	jeff
2003-03-11 22:15:10 +00:00
John Baldwin 427b3a6549 - Change witness_displaydescendants() to accept the indentation level as
a parameter instead of using the level of a given witness.  When
  recursing, pass an indent level of indent + 1.
- Make use of the information witness_levelall() provides in
  witness_display_list() to use an O(n) algorithm instead of an O(n^2)
  algo to decide which witnesses to display hierarchies from.  Basically,
  we only display a hierarchy for witnesses with a level of 0.
- Add a new per-witness flag that is reset at the start of
  witness_display() for all witness's and is set the first time a witness
  is displayed in witness_displaydescendants().  If a witness is
  encountered more than once in the lock order tree (which happens often),
  witness_displaydescendants() marks the later occurrences with the string
  "(already displayed)" and doesn't display the subtree under that
  witness.  This avoids duplicating large amounts of the lock order tree
  in the 'show witness' output in DDB.

All these changes serve to make 'show witness' a lot more readable and
useful than it was previously.
2003-03-11 22:14:21 +00:00
John Baldwin f82c6950be - Split the itismychild() function into two functions: insertchild()
adds a witness to the child list of a parent witness.  rebalancetree()
  runs through the entire tree removing direct descendants of witnesses
  who already have said child witness as an indirect descendant through
  another direct descendant.  itismychild() now calls insertchild()
  followed by rebalancetree() and no longer needs the evil hack of
  having static recursed variable.
- Add a function reparentchildren() that adds all the direct descendants
  of one witness as direct descendants of another witness.
- Change the return value of itismychild() and similar functions so that
  they return 0 in the case of failure due to lack of resources instead
  of 1.  This makes the return value more intuitive.
- Check the return value of itismychild() when defining the static lock
  order in witness_initialize().
- Don't try to setup a lock instance in witness_lock() if itismychild()
  fails.  Witness is hosed anyways so no need to do any more witness
  related activity at that point.  It also makes the code flow easier to
  understand.
- Add a new depart() function as the opposite of enroll().  When the
  reference count of a witness drops to 0 in witness_destroy(), this
  function is called on that witness.  First, it runs through the
  lock order tree using reparentchildren() to reparent direct descendants
  of the departing witness to each of the witness' parents in the tree.
  Next, it releases it's own child list and other associated resources.
  Finally it calls rebalanacetree() to rebalance the lock order tree.
- Sort function prototypes into something closer to alphabetical order.

As a result of these changes, there should no longer be 'dead' witnesses
in the order tree, and repeatedly loading and unloading a module should no
longer exhaust witness of its internal resources.

Inspired by:	gallatin
2003-03-11 22:07:35 +00:00
John Baldwin d5b13ee082 Trim useless "../" leading strings from filenames passed into witness. 2003-03-11 21:53:12 +00:00
John Baldwin 28e4d137a2 Adjust style of #ifdef's and #endif's to be more consistent and in line
with recent additions to style(9).
2003-03-11 21:38:49 +00:00
John Baldwin d278a7f9ba Do the lock order check skip for the LOP_TRYLOCK case after the check for
recursing on a lock instead of before.  This fixes a bug where WITNESS
could get a little confused if you did an sx_tryslock() on a sx lock that
you already had an slock on.  WITNESS would still function correctly but
it could result in weirdness in the output of 'show locks'.  This also
makes it possible for mtx_trylock() to recurse on a lock.
2003-03-11 20:54:37 +00:00
John Baldwin ecdf4409f9 Rework the eventhandler locking for hopefully the last time. The scheme
used popped into my head during my morning commute a few weeks ago, but
it is also very similar (though a bit simpler) to a patch that mini@
developed a while ago.  Basically, each eventhandler list has a mutex and
a run count.  During an eventhandler invocation, the mutex is held while
we traverse the list but is dropped while we execute actual handlers.  Also,
a runcount counter is incremented at the start of an invocation and
decremented at the end of an invocation.  Adding to the list is not a big
deal since the reference of a thread currently executing the handlers
remains valid across an add operation.  Whether or not new handlers are
executed by threads currently executing the handlers for a given list is
indeterminate however.  The harder case is when a handler is removed from
the list.  If the runcount is zero, the handler is simply removed from the
list directly.  If the runcount is not zero, then another thread is
currently executing the handlers of this list, so the priority of this
handler is set to a magic value (currently -1) to mark it as dead.  Dead
handlers are not executed during an invocation.  If the runcount is zero
after it is decremented at the end of an invocation, then a new
eventhandler_prune_list() function is called to remove dead handlers from
the list.

Additional minor notes:
- All the common parts of EVENTHANDLER_INVOKE() and
  EVENTHANDLER_FAST_INVOKE() have been merged into a common
  _EVENTHANDLER_INVOKE() macro to reduce duplication and ease maintenance.
- KTR logging for eventhandlers is now available via the KTR_EVH mask.
- The global eventhander_mutex is no longer recursive.

Tested by:	scottl (SMP i386)
2003-03-11 20:17:00 +00:00
John Baldwin 8d25e77a0d Retire the KTR_LOCKMGR bit and use it to log eventhandler messages
instead as KTR_EVH.
2003-03-11 20:07:22 +00:00
John Baldwin 75d468ee12 Axe the useless MTX_SLEEPABLE flag. mutexes are not sleepable locks.
Nothing used this flag and WITNESS would have panic'd during mtx_init()
if anything had.
2003-03-11 20:02:57 +00:00
John Baldwin 740190593a Use a shorter and less redundant name for the sysctl tree lock. 2003-03-11 20:01:51 +00:00
John Baldwin c06394f53f Use the KTR_LOCK mask for logging events via KTR in lockmgr() rather
than KTR_LOCKMGR.  lockmgr locks are locks just like other locks.
2003-03-11 20:00:37 +00:00
John Baldwin 4c6ffc94c0 Trim leading "../" sequences from filenames. 2003-03-11 19:56:16 +00:00
Jake Burkholder 2089c5c95e Use bus_space_handle_t to represent host port and virtual addresses;
bus_addr_t may not be appropriate.

Sponsored by:	DARPA, Network Associates Laboratories
2003-03-11 19:43:38 +00:00
Sam Leffler ac7e2c0515 FIPS 140-2 rng data tester for h/w crypto devices. This driver periodically
monitors the entropy data harvested by crypto drivers to verify it complies
with FIPS 140-2.  If data fails any test then the driver discards it and
commences continuous testing of harvested data until it is deemed ok.
Results are collected in a statistics block and, optionally, reported on
the console.  In normal use the overhead associated with this driver is
not noticeable.

Note that drivers must (currently) be compiled specially to enable use.

Obtained from:	original code by Jason L. Wright
2003-03-11 19:26:16 +00:00
Sam Leffler 3ff737f4dc correct output byte count statistic collection 2003-03-11 18:43:24 +00:00
Warner Losh 739804813b Remove bogus UNLOCK in if_wi.c. Since we no longer WILOCK() in the
attach routine, calling WIUNLOCK in the error case of one of the ifs
for that routine is now bogus.  This should have been removed when the
WILOCK() was removed, but wasn't.

Submitted by:  "Harti Brandt" <brandt@fokus.fraunhofer.de>
2003-03-11 17:13:33 +00:00
Takanori Watanabe a009cc2a40 Add _HID of IrDA module and Pen tablet on
Tablet PC Acer Travel Mate C100.

Sponsored by: ACER ,Alpha Omega, MYCOM , Synnex
2003-03-11 16:49:06 +00:00
Ruslan Ermilov cf7d67b20e FreeBSD 5.0 has stopped shipping /modules 2.5 years ago. Catch
up with this further by excluding /modules from the (default)
kern.module_path.
2003-03-11 12:09:25 +00:00
Ian Dowse ec8b828fc4 Make uhci_waitintr() robust to interrupts being enabled, even though
it is expected that they will not be enabled at the time that it
is called. This is reported to work around a problem in RELENG_4
where the kernel panics on boot if FAST_IPSEC and crypto support
are enabled.

Tested by:	Scott Johnson <scottj@insane.com>
2003-03-11 09:12:55 +00:00
Jeff Roberson 9ec559555b - Regularize variable usage in cluster_read().
- Issue the io that we will later block on prior to doing cluster read ahead
   so that it is more likely to be ready when we block.
 - Loop issuing clustered reads until we've exhausted the seq count supplied
   by the file system.
 - Use a sysctl tunable "vfs.read_max" to determine the maximum number of
   blocks that we'll read ahead.
2003-03-11 06:14:03 +00:00
David Xu 661db6da35 Lock proc lock before changing p_flag. 2003-03-11 03:16:02 +00:00
David Xu 21e0492ab1 Fix signal delivering bug for threaded process. 2003-03-11 02:59:50 +00:00
Nate Lawson bdc321a648 Quirk for SanDisk ImageMate II compact flash reader
PR:		kern/47877
Submitted by:	Mike Durian <durian@boogie.com>
MFC after:	3 days
2003-03-11 02:07:17 +00:00
Nate Lawson 2a7e0bee37 Quirk for Pentax Optio 230 USB camera. Note that other products probably
use the underlying AsahiOptical USB chip and thus this quirk may need to
be generalized in the future.

PR:		kern/46369
Submitted by:	Tim Vanderhoek <vanderh@ecf.utoronto.ca>
MFC After:	3 days
2003-03-11 01:55:11 +00:00
Nate Lawson bc25d60d7c usbdevs entry for Asahi Optical OPTIO 230 digital camera. Regen. 2003-03-11 01:41:33 +00:00
Eric Anholt acbdeb0ca1 Update Radeon PCI IDs and naming from pciids.sf.net. 2003-03-11 01:38:17 +00:00
David Xu e574e444e0 Fix threaded process job control bug. SMP tested.
Reviewed by: julian
2003-03-11 00:07:53 +00:00
Poul-Henning Kamp e582990901 If we run out of consumers while orphaning them, and the provider's geom
is withering, destroy the provider when done.

This was exposed by the recent change to geom_dev's orphaning logic.
2003-03-10 23:41:41 +00:00
Poul-Henning Kamp e60dce6b42 Fix yet another fallout of our M_* song and dance. 2003-03-10 23:34:12 +00:00
Jake Burkholder 3233337249 "Or" is expressed with 2 separate config lines.
Reported by:	Stijn Hoop <stijn@win.tue.nl>
2003-03-10 23:25:54 +00:00
Alexander Kabaev 72f0679cfa Remove trainling whitespace. 2003-03-10 21:55:00 +00:00
Poul-Henning Kamp 194a0abf73 PHCC[1]:
I had commented the #ifdef INVARIANTS checks out to make sure I ran this
code in all kernels and forgot to comment the #ifdefs back in before I
committed.

Spotted by:	bmilekic

[1] PHCC = Pointy Hat Correction Commit
2003-03-10 20:24:54 +00:00
Poul-Henning Kamp d3c11994e1 Make malloc and mbuf allocation mode flags nonoverlapping.
Under INVARIANTS whine if we get incompatible flags.

Submitted by:   imp
2003-03-10 19:39:53 +00:00
John Baldwin 0e8677f68b Now that we have WITNESS_WARN(), we only call witness_list() from the
ddb 'show locks' command.  Thus, move witness_list() to the #ifdef DDB
section and remove extra checks for calling this function outside of
DDB.  Also, witness_list() now returns void instead of returning an int.

Reported by:	Steve Ames <steve@energistic.com>
Prodded by:	davidxu
2003-03-10 17:03:57 +00:00
Søren Schmidt cad57b089a Remove the enclose_print() call, it is already called from ata-disk.c 2003-03-10 08:20:57 +00:00
Søren Schmidt 7b4cb338ac Dont use r_bmio on Cyrix chips if not set from BIOS. 2003-03-10 08:20:14 +00:00
Marcel Moolenaar e9523c31c5 Fix two rounds of breakages and cleanup. Remove the sccdebug sysctl
while I'm here and garbage collect dead code (ssc_clone). Define
d_maxsize as DFLTPHYS for now because that's what it will be if we
don't define it.
2003-03-10 01:58:31 +00:00
David Malone fca9a10bc1 Add a a sysctl, hw.kbd.keymap_restrict_change, which acts a bit
like secure level but which restricts changes to the keymap. Its
values impose the following restrictions:

0: No restriction - this is the default.
1: Only root can change restricted keys (like boot, panic, ...)
2: Only root can change restricted keys and regular keys.
   Other users still can change accents and function keys.
3: Only root can change restricted keys, regular keys and accents.
4: Only root can change any of the keymap (restricted keys, regular
      keys, accents and function keys).

Unfortunately, the keyboard's accent map is cleared when a new keymap
is loaded, which makes the distinction between level 3 and level 4
less useful.

The MAC guys might like to make this a policy?

No objections from: -audit about 6 moths ago
2003-03-09 22:49:48 +00:00
Poul-Henning Kamp 45901e280b Don't call make_dev() before we are ready for it. 2003-03-09 20:42:49 +00:00
Alan Cox 167b972088 Remove some unnecessary actions by the zero-copy setup and teardown code.
Remove an incorrect comment.  (Incrementing an object's reference count
does not prevent a process from exiting.  The real concern here is that the
physical page must not be deleted until transmission is complete.  That is
already handled by the VM system and sf_buf_free().)

Tested by:	ken
2003-03-09 20:38:56 +00:00
Shunsuke Akiyama 20280807ca Fix device freeze to reduce output packet size.
And make this value configurable by kernel config or sysctl.
2003-03-09 11:50:27 +00:00
Shunsuke Akiyama 4e6f1adc6b Fix page fault with FTDI's USB serial device.
Fix lost characters counting.
Move setting receiver state to proper place on ucomstopread().
2003-03-09 11:33:26 +00:00
Shunsuke Akiyama 86aa13bdbf Fix duplicate sc_dying usage.
All drivers which depend on ucom interfaces should use only one
sc_dying.
2003-03-09 11:19:18 +00:00
Shunsuke Akiyama 5ce609f75b Add missing module dependency. 2003-03-09 11:14:34 +00:00
Poul-Henning Kamp d42ee4e410 Note that MAJOR_AUTO is now the default if d_maj is not initialized. This
is more robust and prevents the hijacking of /dev/console for the typical
mistake.

Remove unneeded MAJOR_AUTO uses, it is only needed explicitly now if the
driver source has cross-branch compatibility to old releases.
2003-03-09 11:03:45 +00:00
Poul-Henning Kamp 441931b53c Define MAJOR_AUTO as zero, which means that leaving out an initialization
of d_maj means "allocate major number automatically".

Keep the definition of MAJOR_AUTO to make life easier for cross-branch
source maintainers.
2003-03-09 10:29:20 +00:00
Poul-Henning Kamp 06a8bb906c Add one little hack to allow us to make MAJOR_AUTO be zero:
Let the console driver ask for major 256 and magically change this to
mean zero.
2003-03-09 10:28:05 +00:00
Yoshihiro Takahashi e76a843b59 MFi386: revision 1.1079 2003-03-09 10:20:16 +00:00
Yoshihiro Takahashi 26db0f997b Merged from sys/dev/syscons/syscons.c revision 1.396. 2003-03-09 10:18:15 +00:00
Yoshihiro Takahashi 947878824d Merged from sys/dev/sio/sio.c revisions 1.387 and 1.388. 2003-03-09 10:15:11 +00:00
Yoshihiro Takahashi 484be8eac1 Build the drm module also on pc98. 2003-03-09 10:12:58 +00:00
Poul-Henning Kamp 564632b081 Remove unneeded #include of geom_stats.h 2003-03-09 10:04:21 +00:00
Poul-Henning Kamp f48b881942 Stamp out Danglish. 2003-03-09 10:02:31 +00:00
Poul-Henning Kamp 0e6be4723b Don't use statistics counters to detect outstanding I/O. 2003-03-09 10:01:16 +00:00
Poul-Henning Kamp c6ae9b5fd2 Don't abuse the statistics counters for detecting if we have outstanding
I/O requests, instead use the new dedicated fields in the consumer and
provider to track this.
2003-03-09 09:59:48 +00:00
Poul-Henning Kamp 0e082fcca2 Add u_int nstart, nend counters to consumer and providers so we will not
have to examine the stats structure to tell if we have outstanding I/O
requests.

Making them u_int improves the chance of atomic updates to them,
but risks roll-over.  Since the only interesting property is if
they are equal or not, this is not an issue.
2003-03-09 09:58:36 +00:00
Poul-Henning Kamp df6c9fe955 When a DEV class consumer is orphan'ed we need to wait for all the
outstanding requests to return before we unravel the mesh.

It is very important that the stuff below us plays nice and don't
overlook a couple of outstanding bio's, because until they remember
the geom event thread is blocked.  At an expense in code here this
could be made more robust, but I actually _want_ a robust failure
in this case so any offending drivers can be fixed.
2003-03-09 09:28:45 +00:00
David Xu d03c79eea1 Cosmetic change, make it QUEUE_MACRO_DEBUG friendly 2003-03-09 04:27:46 +00:00
Eric Anholt 43e2d1e384 Update the DRM to latest from DRI CVS. This is approximately the version
included in XFree86 4.3, but includes some fixes.  Notable changes include
Radeon 8500-9100 support, PCI Radeon/Rage 128 support, transform & lighting
support for Radeons, and vblank syncing support for r128, radeon, and mga.
The gamma driver was removed due to lack of any users.
2003-03-09 02:08:30 +00:00
Tim J. Robbins ef3dab76bf Hold the proc lock while accessing p_procsig in trapsignal(). 2003-03-09 01:40:55 +00:00
Jonathan Lemon fb68148f4a Discard the packet if the netisr queue is null instead of panicing, for
the benefit of modules which are compiled differently than the kernel.
2003-03-08 22:12:32 +00:00
Jonathan Lemon a3b6edc353 Remove check for t_state == TCPS_TIME_WAIT and introduce the tw structure.
Sponsored by: DARPA, NAI Labs
2003-03-08 22:07:52 +00:00
Jonathan Lemon 607b0b0cc9 Remove a panic(); if the zone allocator can't provide more timewait
structures, reuse the oldest one.  Also move the expiry timer from
a per-structure callout to the tcp slow timer.

Sponsored by: DARPA, NAI Labs
2003-03-08 22:06:20 +00:00
Jonathan Lemon 921f8bb982 Fix module build by adding options to Makefile. 2003-03-08 21:54:32 +00:00
Poul-Henning Kamp f37de12275 Retire devstat_add_entry() as a public function and bump __FreeBSD_version
to mark this act.
2003-03-08 21:46:43 +00:00
Poul-Henning Kamp a9d2245ea8 Allocate the devstat structure with devstat_new_entry(). 2003-03-08 21:44:46 +00:00
John Polstra 537b41d5ff Correct names for fxp devices. Sort data by devid in
fxp_ident_table.

PR:		kern/48699
Submitted by:	Sergey A. Osokin <osa@FreeBSD.org.ru>
Obtained from:	NetBSD (the device strings, that is)
MFC after:	4 weeks
2003-03-08 21:44:21 +00:00
Poul-Henning Kamp 8098046099 Allocate the devstat structure with devstat_new_entry(). 2003-03-08 21:32:59 +00:00
Poul-Henning Kamp 09f958046c Allocate devstat structure with devstat_new_entry(). 2003-03-08 20:00:11 +00:00
Poul-Henning Kamp c7e73d59c4 Introduce a device driver for /dev/devstat, this will allow us to mmap
the device statistics structures into userland instead of using sysctl.

Introduce new devstat_new_entry() function which allocates the devstat
structure an calls devstat_add_entry() on it.
2003-03-08 19:58:57 +00:00
Poul-Henning Kamp bfd614b8a5 Augment the devstat structure with 3 new fields and bump the DEVSTAT_VERSION.
Two fields are sequence numbers for integrity check when we switch devstat
to use mmap to export data rather than sysctl, the last field is to mark
this as an allocated devstat entry.
2003-03-08 19:55:59 +00:00
Jonathan Lemon 06acad4aa4 Revert last change and insure the driver can support other address families.
Pointed out by: ume, matusita
2003-03-08 17:32:21 +00:00
Jonathan Lemon e0e6419344 The tun driver is INET only. Don't pretend to support other address families.
Sponsored by: DARPA, NAI Labs
2003-03-08 16:26:34 +00:00
Jonathan Lemon 8c90439d70 Include correct opt_* headers for supported address families. Dike out
the unused ATM cases.

Sponsored by: DARPA, NAI Labs
2003-03-08 16:25:27 +00:00
Poul-Henning Kamp 60794e0478 Centralize the devstat handling for all GEOM disk device drivers
in geom_disk.c.

As a side effect this makes a lot of #include <sys/devicestat.h>
lines not needed and some biofinish() calls can be reduced to
biodone() again.
2003-03-08 08:01:31 +00:00
Tim J. Robbins 74c69254e6 Remove unimplemented IP-in-IPX encapsulation support (options IPTUNNEL). 2003-03-08 06:58:22 +00:00
Kenneth D. Merry 9b80d344ec Zero copy send and receive fixes:
- On receive, vm_map_lookup() needs to trigger the creation of a shadow
  object.  To make that happen, call vm_map_lookup() with PROT_WRITE
  instead of PROT_READ in vm_pgmoveco().

- On send, a shadow object will be created by the vm_map_lookup() in
  vm_fault(), but vm_page_cowfault() will delete the original page from
  the backing object rather than simply letting the legacy COW mechanism
  take over.  In other words, the new page should be added to the shadow
  object rather than replacing the old page in the backing object.  (i.e.
  vm_page_cowfault() should not be called in this case.)  We accomplish
  this by making sure fs.object == fs.first_object before calling
  vm_page_cowfault() in vm_fault().

Submitted by:	gallatin, alc
Tested by:	ken
2003-03-08 06:58:18 +00:00
David Xu b4508d7d3f Lock sched_lock before modifying td_flags. 2003-03-08 04:09:04 +00:00
David Xu 1108975fe0 Initialize eflags in fake frame to default value rather than random one.
The random value sometimes causes macro CLKF_USERMODE to return true
because PSL_VM bit is set and really shoudn't be, this causes statclock()
to execute in wrong path, and further breaks KSE code and kernel crashes
when executing threaded program.
2003-03-08 03:58:50 +00:00
Kirk McKusick 34968037b1 Use the appropriate size when zeroing out the unused portion
of a snapshot's copy of a superblock. This patch fixes a panic
when taking a snapshot of a 4096/512 filesystem.

Reported by:	Ian Freislich <ianf@za.uu.net>
Sponsored by:   DARPA & NAI Labs.
2003-03-07 23:49:16 +00:00
Andrey A. Chernov 864b284996 Replace u_int with "unsigned int" to prevent following errors:
#include <sys/types.h>
#include <sys/stat.h>

main () {
}

cc -D_POSIX_C_SOURCE test.c
/usr/include/sys/stat.h:127: syntax error before "u_int"
/usr/include/sys/stat.h:158: syntax error before "u_int"

(u_int becomes invisible for _POSIX_C_SOURCE and some other *_SOURCE modes)
2003-03-07 23:11:37 +00:00
Rob Braun d132c84f07 Fix a spelling error.
Submitted by:	jkh
Reviewed by:	zarzycki
2003-03-07 22:47:32 +00:00
John Baldwin 9722121a3c Respect any passed in external lockmgr flags such as LK_NOWAIT in the
default implementations of VOP_LOCK() and VOP_UNLOCK().

Tested by:	jlemon, phk
Glanced at by:	jeffr
2003-03-07 20:45:07 +00:00
Poul-Henning Kamp ea6ff0649f Limit our requests to DFLTPHYS, this is generally a good idea for
memory-allocation purposes.  Right now it is also a very good idea
because we hit a Giant assertion in the free(9) processing if we
free something larger than 64k.
2003-03-07 19:09:46 +00:00
Tim J. Robbins f69d0d7067 Set f_fstypename in coda_nb_statfs(). 2003-03-07 09:18:15 +00:00
Tom Rhodes ff470880ba Fix a few spelling errors.
Submitted by:	Stefan Farfeleder <stefan@fafoe.dyndns.org> via -doc.
2003-03-07 03:24:38 +00:00
Hidetoshi Shimokawa 3b79dd164b - improve timeout handling in fwmem.c
- stop processing of TX db if we reaches the end of active db.
2003-03-07 02:51:59 +00:00
Justin T. Gibbs 2cd3cc377a aic79xx.c:
Include read streaming in the PPR flags we display in diagnostics.

	In ahd_reset(), set the known mode after our initial pause prior to
	setting the mode. We can't just set the mode directly because the
	current mode, after the pause, is most likely unknown and setting the
	mode when the saved mode is unknown will trigger an assertion in
	the mode debug code.

	Complete an audit for SCB RAM reads.  These reads must be performed
	via the special ahd_in?_scbram() methods so we can perform a
	Rev A. PCI-X workaround.

	Remove a superfluous mode save operation that was performed just
	prior to a call to ahd_clear_critical_section().  The saved mode
	was never restored and wouldn't have been valid anyway since the
	mode could change while single stepping out of a critical section.

aic79xx.h:
	Add new BUG definition AHD_PCIX_SCBRAM_RD_BUG.

aic79xx_inline.h:
	Update ahd_inb_scbram routine to check for AHD_PCIX_SCBRAM_RD_BUG
	and only apply the workaround if this bug is active.  The old code
	applied the workaround in all cases.

aic79xx_pci.c:
	Set AHD_PCIX_SCBRAM_RD_BUG for the A4.

	Remove an attempted saved_modes call in ahd_pci_test_register_access().
	Saving the modes can only occur when we are paused, but the call was
	happening before the chip was known to be paused.  Restoring the
	modes doesn't make sense either since the code makes no assumptions
	about the state of the sequencer until the first time the mode is set
	by the driver.  This happens after the registers are successfully
	mapped.
2003-03-06 23:58:34 +00:00
Kirk McKusick 9a9906281f When the system is panicing, the lock manager grants all lock
requests whether or not the lock is available. To avoid "unlocked
buffer" panics after a crash, we just claim that all buffers
are locked when cleaning up after a system panic.

Reported by:	Attila Nagy <bra@fsn.hu>
Sponsored by:   DARPA & NAI Labs.
2003-03-06 21:40:07 +00:00
John Baldwin 9da590b49b Oops, fix the double faults people were seeing with the recent changes to
witness.  Sleepable locks such as sx locks always come before all mutexes
including Giant.  However, the static lock order list placed Giant before
the proctree and allproc sx locks.  This resulted in witness creating a
cycle in its lock order "tree" (real trees don't have cycles) leading to
infinite recursion and eventually a double fault.  To fix, put Giant after
sx locks in the lock order list.
2003-03-06 17:25:06 +00:00
Takanori Watanabe b256620797 Add integer value of _CID handling.
If _CID is string, it will need more complicated
handling to distinguish bus other than ISA.

Submitted by: Paul Wankadia <junyer@gmx.net>
2003-03-06 14:40:15 +00:00
Tim J. Robbins 1303bfb807 Add a temporary workaround for a deadlock in Coda venus 5.3.19 that
occurs when mounting the filesystem. The problem is that venus issues
the mount() syscall, which calls vfs_mount(), which calls coda_root()
which attempts to communicate with venus.
2003-03-06 10:48:03 +00:00
Tim J. Robbins fe72c63e22 Remove fragments of support for the FreeBSD 3.x and 4.x branches. 2003-03-06 10:38:18 +00:00
Hidetoshi Shimokawa 2b4601d10b MFp4(simokawa_sbp)
Improve if_fwe performance.
- Simplify mbuf handling by using bulkxfer.
	Now, it uses mbuf clusters for RX buffer as usual ethernet drivers.
- Recycle struct xfer buffer and don't call malloc at runtime.
- Count input and output errors.
- Handle a mbuf chain longer than 6 correctly.
- Increase queue length.
2003-03-06 05:06:44 +00:00
Alan Cox 7c4351aabd Remove GIANT_REQUIRED from sf_buf_free(). 2003-03-06 04:48:19 +00:00
Robert Watson 9283578946 Instrument sysarch() MD privileged I/O access interfaces with a MAC
check, mac_check_sysarch_ioperm(), permitting MAC security policy
modules to control access to these interfaces.  Currently, they
protect access to IOPL on i386, and setting HAE on Alpha.
Additional checks might be required on other platforms to prevent
bypass of kernel security protections by unauthorized processes.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-03-06 04:47:47 +00:00
Alan Cox 09c80124a3 Remove ENABLE_VFS_IOOPT. It is a long unfinished work-in-progress.
Discussed on:	arch@
2003-03-06 03:41:02 +00:00
Robert Watson 1b2c2ab29a Provide a mac_check_system_swapoff() entry point, which permits MAC
modules to authorize disabling of swap against a particular vnode.

Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-03-05 23:50:15 +00:00
Robert Watson a184d471e2 Move the initialization of the vattr flags field in setfflags() to
before the MAC check so that we pass the flags field into the MAC
check properly initialized.  This didn't affect any current MAC
modules since they didn't care what the flags argument was (as
they were primarily interested in the fact that it was a meta-data
write, not the contents of the write), but would be relevant to
future modules relying on that field.

Submitted by:	Mike Halderman <mrh@spawar.navy.mil>
Obtained from:	TrustedBSD Project
Sponsored by:	DARPA, Network Associates Laboratories
2003-03-05 23:15:23 +00:00
Archie Cobbs 2b2a8188b1 Fix a use-after-free bug that could cause multi-link fragment reassembly to
fail for a long time (until the incoming sequence numbers wrapped around).

Reported by:	Matthew Impett <mimpett@Glue.umd.edu>
MFC after:	3 days
2003-03-05 23:12:59 +00:00
Tim J. Robbins 6a08d399b1 VOP_PATHCONF returns a register_t, not an int. Noticed by phk. 2003-03-05 22:30:02 +00:00
Peter Wemm 3c6b084e96 Finish driving a stake through the heart of netns and the associated
ifdefs scattered around the place - its dead Jim!

The SMB stuff had stolen AF_NS, make it official.
2003-03-05 19:24:24 +00:00
Duncan Barclay 4becbcddc0 Retire some misleading comments and explain why we need to keep a copy
of parameters written to the card.
2003-03-05 18:13:19 +00:00
John Baldwin 8b18ef15a4 Duplicate more of options.i386 in this file since we can't seem to settle
on a notion of having MACHINE_ARCH common files that MACHINE files include.
2003-03-05 18:12:48 +00:00
Orion Hodson a7576e2e4b Back out last commit, which is fine in theory, but ignores the fact
that a lock is held whilst the allocations are made (M_WAITOK -> M_NOWAIT).
2003-03-05 14:48:28 +00:00
Tim J. Robbins 9d3570325d Add prototype for coda_pathconf() that I missed in the previous commit. 2003-03-05 13:48:51 +00:00
Takeshi Shibagaki ca49234e7c Used correct aue_flags in ELECOM LD-USB/T and ELECOM LD-USB/TX.
Submitted by: Yasushi Oshima <oshimaya@sc.starcat.ne.jp>
              Takeshi Shibagaki <shiba@freebsd.org>
                 (refer to [bsd-usb:685],[bsd-usb:686])
2003-03-05 13:25:35 +00:00
Takeshi Shibagaki f6e333276b Fixed an issue which transfer no packets in combination with aue driver.
Submitted by Hiroyuki Aizu <eyes@navi.org>
                (refer to [FreeBSD-users-jp 65061])
Tested by    Hiroharu Tamaru <tamaru@myn.rcast.u-tokyo.ac.jp>
                (refer to [bsd-usb:689])
2003-03-05 13:17:15 +00:00
Tim J. Robbins 7054fe2735 Add a minimal implementation of VOP_PATHCONF to silence warning
messages from ls(1).
2003-03-05 10:23:51 +00:00
Tim J. Robbins 11aca4935c Handle the case where a_uio->uio_td == NULL properly in coda_readlink().
This happens when called from lookup().
2003-03-05 09:52:04 +00:00
David Schultz ee844411e9 Raise the default value of TTYHOG from 1 kB to 8 kB. Since TTYHOG is
an administrative limit on the size of tty/pty input buffers, this is
mostly an inconsequential change.  (slti(4) will allocate an 8 kB
static buffer instead of a 1 kB buffer due to a hack in the driver.)
The increase happens to kludge around a lame limitation of syscons,
which does not allow one to paste more than TTYHOG bytes.

PR:		42031
Reviewed by:	mike (mentor)
2003-03-05 08:17:10 +00:00
David Schultz 9c62b3ee7c Make TTYHOG tunable.
Reviewed by:	mike (mentor)
2003-03-05 08:16:29 +00:00
Orion Hodson 876d09d890 Attempt a hard reset if AC97 codec is not ready on attach.
Halt attach if mixer_init fails.

Prompted by: points raised by Hugo Valentim <hvalentim@gmx.net>.
2003-03-05 05:56:18 +00:00
Marcel Moolenaar cafd6dbd76 Fix threaded applications on ia64 that are linked dynamicly. We did
not save (restore) the global pointer (GP) in the jmpbuf in setjmp
(longjmp) because it's not needed in general. GP is considered a
scratch register at callsites and hence is always restored after a
call (when it's possible that the call resolves to a symbol in a
different loadmodule; otherwise GP does not have to be saved and
restored at all), including calls to setjmp/longjmp. There's just
one problem with this now that we use setjmp/longjmp for context
switching: A new context must have GP defined properly for the
thread's entry point. This means that we need to put GP in the
jmpbuf and consequently that we have to restore is in longjmp.
This automaticly requires us to save it as well.

When setjmp/longjmp isn't used for context switching, this can be
reverted again.
2003-03-05 04:39:24 +00:00
Marcel Moolenaar a402169a8e ABI breaker: Move the J_SIGMASK field in the jmpbuf before
the J_SIG0 field. While here, rename J_SIG0 to J_SIGSET and
remove J_SIG1. The main reason for this change is that the
128-bit sigset_t is now aligned on a 16-byte boundary, which
allows us to use 16-byte atomic loads and stores on CPUs that
support it. The removal of J_SIG1 is done to avoid confusion:
it is never accessed and should not be. Renaming J_SIG0 to
J_SIGSET is the icing on the cake that's better done now than
later.
2003-03-05 03:30:54 +00:00
Hidetoshi Shimokawa 9ca8add364 Set ldesc after dbch->ndesc has initialized. 2003-03-05 01:50:57 +00:00
Sean Chittenden 6087c960b5 Document the tunable kern.ipc.nsfbufs in help.common and loader.8. Small
nearby grammar fixup that saves a line of display while in the loader
(help set tunables), but reuses the line for kern.ipc.nsfbufs.

Approved by:	 roam
2003-03-04 23:46:29 +00:00
Jonathan Lemon f0757123c9 GC unused files. 2003-03-04 23:28:19 +00:00
Jonathan Lemon 1cafed3941 Update netisr handling; Each SWI now registers its queue, and all queue
drain routines are done by swi_net, which allows for better queue control
at some future point.  Packets may also be directly dispatched to a netisr
instead of queued, this may be of interest at some installations, but
currently defaults to off.

Reviewed by: hsu, silby, jayanth, sam
Sponsored by: DARPA, NAI Labs
2003-03-04 23:19:55 +00:00
John Baldwin c141c242ac Bah, fix a bogon in the last commit: get the sense of a compare test right
so that we allow a sleepable lock to be acquired with Giant held rather
than allowing a sleepable lock to be acquired with anything but Giant held.
2003-03-04 22:34:07 +00:00
Jeff Roberson 24deed1aaa - Hold the buf lock while manipulating and inspecting its fields.
- Use gbincore() and not incore() so that we can drop the vnode interlock
   as we acquire the buflock.
 - Use GB_LOCK_NOWAIT when getting bufs for read ahead clusters so that we
   don't block on locked bufs.
 - Convert a while loop to a howmany() that will most likely be faster on
   modern processors.  There is another while loop divide that was left
   near by because it is operating on a 64bit int and is most likely faster.
 - Cleanup the cluster_read() code a little to get rid of a goto and make
   the logic clearer.

Tested on:	x86, alpha
Tested by:	Steve Kargl <sgk@troutmask.apl.washington.edu>
Reviewd by:	arch
2003-03-04 21:35:28 +00:00
John Baldwin 1106937d99 Remove safety belt: it is now ok to do a mtx_trylock() on a mutex you
already own.  The mtx_trylock() will fail however.  Enhance the comment
at the top of the try lock function to explain this.

Requested by:	jlemon and his evil netisr locking
2003-03-04 21:32:25 +00:00
John Baldwin 263067951a Replace calls to WITNESS_SLEEP() and witness_list() with equivalent calls
to WITNESS_WARN().
2003-03-04 21:03:05 +00:00
John Baldwin 9b4982bfed Add a WITNESS_WARN() call to verify that we hold no locks after running
a handler from an interrupt thread.
2003-03-04 21:01:42 +00:00