Commit graph

42497 commits

Author SHA1 Message Date
Peter Wemm 882554f111 MFi386: machdep.c:1.570 clock.c:1.204 by bde: Quick fix for calling DELAY
for ddb input in some atkbd-based console drivers.  ddb must not use any
normal locks but DELAY() normally calls getit() which needs clock_lock.
This also removes the need for recursion on clock_lock.
2003-09-22 21:56:48 +00:00
Peter Wemm 795a3f5279 Microoptimization to allow the compiler to evaluate ntohl() etc on
known constants at compile time rather than at run time.  We have a number
of nasty hacks around the place to cache ntohl() of constants (eg: nfs).
This change allows the compiler to compile-time evaluate ntohl(1) as
0x01000000 rather than having to emit assembler code to do it.  This
has other smaller flow-on effects because the compiler can see that
ntohl(constant) itself has a constant value now and can propagate the
compile time evaluation.

Obtained from:  Ideas from NetBSD and Linux, and some code from NetBSD
2003-09-22 21:46:47 +00:00
Peter Wemm 316e93e35f Simplify the KOBJOPLOOKUP macro for the non-debug case so that gcc's
heuristics do not overestimate the code size quite so much.
2003-09-22 21:32:49 +00:00
Thomas Moestl a65aa77700 Fix inverted BURN_BRIDGES and GONE_IN_5 #ifdefs. 2003-09-22 17:58:40 +00:00
Dag-Erling Smørgrav e705f0f0f9 Previous commit contained too-smart-for-its-own-good code that might
produce incorrect (though harmless) output on single-CPU systems.
2003-09-22 16:05:11 +00:00
Dag-Erling Smørgrav e54c4ad8ac Fake multi-cpu statistics for proc/stat by dividing the totals by the
number of CPUs.

PR:		kern/27522
2003-09-22 15:52:32 +00:00
Peter Grehan 84792e72d6 Soften assert in pmap_remove_all.
Introduct pmap_extract_and_hold.

Stolen from: sparc64
2003-09-22 11:59:05 +00:00
Peter Grehan 250fe3a662 ATAng requires <sys/taskqueue.h> 2003-09-22 11:55:02 +00:00
Warner Losh 2e6a21aa7f Sony PEGA-WL110 Wireless LAN
Obtained from: NetBSD (onoe-san)
2003-09-22 05:33:22 +00:00
Warner Losh f1bbdf43f2 sync to 1.72 2003-09-22 05:27:33 +00:00
Warner Losh 4091833eb6 Merge from NetBSD:
1.186: onoe; Sony's PEGA-WL110 CF WLAN (which strangely has fujitsu's
   vendor id)
1.185: ichiro; Quatech Inc, PCMCIA Enhanced Parallel Port Card

Also:
o update $NetBSD$
o minor tweaks to FUJITSU.  We've tried to keep the CIS only entries seprate
  from vendor id/product id.
2003-09-22 05:27:03 +00:00
Nate Lawson 0588717032 Add an off_t cast to prevent overflow on media size. This should
fix issues with geometry not matching drive size.

Submitted by:	Clive Lin <clive@tongi.org>
2003-09-22 04:59:07 +00:00
Alan Cox c76789caa6 - vm_hold_free_pages() should lock the kernel object. (The pages being
freed belong to the kernel object.)
 - Increase the granularity of the vm object locking in vm_hold_load_pages()
   in order to reduce the number of times that we acquire and release the
   same lock.
2003-09-22 04:58:09 +00:00
Nate Lawson a6a1d01594 Fix the ACPI_DEBUG case.
Reported by:	Larry Rosenman <ler@lerctr.org>
PR:
Submitted by:
Reviewed by:
Approved by:
Obtained from:
MFC after:
2003-09-22 04:50:29 +00:00
Alan Cox 95aad59a53 Initialize the page's pindex field even for VM_ALLOC_NOOBJ allocations.
(This field is useful for implementing sanity checks even if the page does
not belong to an object.)
2003-09-22 00:56:13 +00:00
Alan Cox be19fdd17e Allocate the page table directory page(s) as "no object" pages. (This
leaves one explicit use of the pte object.)
2003-09-21 21:36:13 +00:00
Poul-Henning Kamp fb4d4b60b3 Make the clone handler BURN_BRIDGES but the actual 'a' and 'c' partition
check GONE_IN_5:  We need the clone handler for root filesystem case.

Once under GEOM, we can remove the clone handler as GEOM provides one.
2003-09-21 18:57:12 +00:00
Poul-Henning Kamp d2f243d06a Make this compile. 2003-09-21 18:54:52 +00:00
Thomas Quinot 505d8ea4f1 (atapi_cb): Reorganize error handling circuitry.
Fix to the messages output under CAM_DEBUG_CCB: the summary sense
 information (error bits and sense key) is in the error field, not
 in the result field, of struct ata_request. No other functional change.
2003-09-21 16:49:53 +00:00
Thomas Quinot 1a2ede86a0 (atapi_cb): Disable autosense for now as it causes a missed ATA interrupt.
Minor reformatting.
2003-09-21 08:53:05 +00:00
Thomas Quinot a035059fc1 (scsi_request_sense): Set allocation length in REQUEST_SENSE CCB.
Reviewed by:	ken
2003-09-21 08:45:36 +00:00
Thomas Quinot 86addc5271 (camperiphdone): When the cam_periph layer performs sense recovery,
completion of recovery is indicated by positioning the CAM_AUTOSNS_VALID
 bit in the status field of the CCB, not in the flags field.
This fixes an endless loop of sense recovery actions.

Reviewed by:	ken
2003-09-21 08:42:32 +00:00
Jeff Roberson 009b6fcb03 - Fix MD_SMALL_ALLOC on architectures that support it. Define a new alloc
function, startup_alloc(), that is used for single page allocations prior
   to the VM starting up.  If it is used after the VM startups up, it
   replaces the zone's allocf pointer with either page_alloc() or
   uma_small_alloc() where appropriate.

Pointy hat to:	me
Tested by:	phk/amd64, me/x86
2003-09-21 07:39:16 +00:00
Nate Lawson be8dca590c Add support for fixed event buttons defined in the DSDT (HID "ACPI_FSB"
and "ACPI_FPB").

Pointed out by:		Linux
2003-09-21 02:49:59 +00:00
Alan Cox f8363bdee9 Reimplement pmap_release() such that it uses the page table rather than the
pte object to locate the page table directory pages.  (This is another step
toward the elimination of the pte object.)
2003-09-20 23:54:36 +00:00
Peter Wemm c43ab0b5a1 Bad Jeffr! No cookie!
Temporarily disable the UMA_MD_SMALL_ALLOC stuff since recent commits
break sparc64, amd64, ia64 and alpha.  It appears only i386 and maybe
powerpc were not broken.
2003-09-20 23:35:33 +00:00
Bill Paul edd033746c Remove the dual-address cycle stuff. DAC is used to allow a bus master
device to access 64-bit addresses from a 32-bit PCI bus. While the
RealTek manual says you can set this bit and the chip will perform
DAC only if you give it a DMA address with any of the upper 32
bits set, this appears not to be the case. If I turn on the DAC
bit, the chip sets the 'system error' bit in the status register
when I to do a DMA on my Athlon test box with 32-bit PCI bus (VIA
chipset) even though I only have 128MB of physical memory, and thus
can never give the chip a 64-bit address.

Obviously, I can't just set it and forget it, so until I figure
out the right rule for when it's safe/necessary to enable it, keep
it turned off.
2003-09-20 21:18:27 +00:00
Marcel Moolenaar 719325db8e Fix the last remaining problem encountered by KSE: apparently it is
not guaranteed that the RSE writes the NaT collection immediately,
sort of atomically, to the backing store when it writes the register
immediately prior to the NaT collection point. This means that we
cannot assume that the low 9 bits of the backingstore pointer do not
point to the NaT collection. This is rather a surprise and I don't
know at this time if it's a bug in the Merced or that it's actually
a valid condition of the architecture. A quick scan over the sources
does not indicate that we depend on the false assumption elsewhere,
but it's something to keep in mind.

The fix is to write the saved contents of the ar.rnat register to
the backingstore prior to entering the loop that copies the dirty
registers from the kernel stack to the user stack.
2003-09-20 20:34:58 +00:00
Stefan Eßer cf3153c9c9 Add vendor Samsung and device Samsung ML-6060. 2003-09-20 20:01:08 +00:00
Marcel Moolenaar b8d941f010 Move uma_small_alloc() and uma_small_free() to uma_machdep.c. These
functions reference UMA internals from <vm/uma_int.h>, which makes
them highly unwanted in non-UMA specific files.

While here, prune the includes in pmap.c and use __FBSDID(). Move
the includes above the descriptive comment.

The copyright of uma_machdep.c is assigned to the project and can
be reassigned to the foundation if and when when such is preferrable.
2003-09-20 19:27:48 +00:00
Warner Losh 1bbd0d4010 EXPsys PCMCIA Ethernet Combo
Submitted by: Ludwig Pummer
2003-09-20 18:03:07 +00:00
Warner Losh 37c3193030 update to 1.71 2003-09-20 18:01:51 +00:00
Warner Losh 734b8bcbac EXPsys PCMCIA Ethernet Combo
Submitted by: Ludwig Pummer
2003-09-20 17:54:30 +00:00
Warner Losh 89aea6d530 Remove unused #defines. 2003-09-20 17:46:39 +00:00
Doug Rabson ab7a2646e0 The method link_preload_finish is not static. 2003-09-20 17:39:32 +00:00
Jake Burkholder cfbe010793 Remove an invalid KASSERT. Apparently pmap_remove_all gets called on
unmanaged pages.
2003-09-20 17:00:59 +00:00
Wilko Bulte 95ad0a1f28 Add missing file, it is sorely needed to make if_sk.c compile again. 2003-09-20 15:49:22 +00:00
Wilko Bulte 59ce78fef1 Add support for SK-9521 V2.0 and 3COM 3C940.
Tested at 100Mbit only, using Asus P4P800 onboard 3C940.
The -stable version of this patch I have in use for ~2 weeks now, and works
just fine for me.

Based on: Nathan L. Binkert's patch for OpenBSD
Patch submitted by and thanks to: Jung-uk Kim <jkim@niksun.com>
MFC after: 2 weeks
2003-09-20 10:53:08 +00:00
Søren Schmidt bcf5e4d6b1 Dont reject a master device if it said slave failed. 2003-09-20 08:38:33 +00:00
Gary Jennejohn eb3c983360 In umass_bbb_get_max_lun() move maxlun to before the DPRINTF so that
the actual number of LUNs is printed.
2003-09-20 08:18:16 +00:00
Warner Losh 45a3024ec7 New Proxim Harmony OEM card.
Submitted by: Jeremy Bingham
2003-09-20 05:27:18 +00:00
Warner Losh 7558e6858e sync to 1.70 2003-09-20 05:24:50 +00:00
Warner Losh ea1349a34b OEM version of Proxim Harmony card
Submitted by: Jeremy Bingham
2003-09-20 05:23:50 +00:00
Jeff Roberson 81de51bf1d - Somewhere along the line I stupidly removed critical logic from
sched_ptcpu_update().  This caused erroneous cpu times in TOP for
   processes that were asleep.  Replace the code that was removed.
2003-09-20 02:05:58 +00:00
Jeff Roberson 51b575490c - In reassignbuf() don't unlock vp and lock newvp if they are the same.
Doing so creates a race where the buf is on neither list.
 - Only vfree() in an error case in vclean() if VSHOULDFREE() thinks we
   should.
 - Convert the error case in vclean() to INVARIANTS from DIAGNOSTIC as this
   really should not happen and is fast to check.
2003-09-20 00:21:48 +00:00
Jeff Roberson 6b6c163a37 - Remove spls(). The locking that has replaced them is in place and they
no longer serve as guidelines for future work.
2003-09-19 23:52:06 +00:00
Jeff Roberson ce1fb23146 - Remove interlock protection around VI_XLOCK. The interlock is not
sufficient to guarantee that this race is not hit.  The XLOCK will likely
   have to be redesigned due to the way reference counting and mutexes work
   in FreeBSD.  We currently can not be guaranteed that xlock was not set
   and cleared while we were blocked on the interlock while waiting to check
   for XLOCK.  This would lead us to reference a vnode which was not the
   vnode we requested.
 - Add a backtrace() call inside of INVARIANTS in the hopes of finding out if
   this condition is ever hit.  It should not, since we should be retaining
   a reference to the vnode in these cases.  The reference would be sufficient
   to block recycling.
2003-09-19 23:37:49 +00:00
Jeff Roberson 9643769a3a - Remove the working-set algorithm. Instead, use the per cpu buckets as the
working set cache.  This has several advantages.  Firstly, we never touch
   the per cpu queues now in the timeout handler.  This removes one more
   reason for having per cpu locks.  Secondly, it reduces the size of the zone
   by 8 bytes, bringing it under 200 bytes for a single proc x86 box.  This
   tidies up other logic as well.
 - The 'destroy' flag no longer needs to be passed to zone_drain() since it
   always frees everything in the zone's slabs.
 - cache_drain() is now only called from zone_dtor() and so it destroys by
   default.  It also does not need the destroy parameter now.
2003-09-19 23:27:46 +00:00
Jeff Roberson 3e0cab95c0 - Remove the cache colorization code. We can't use it due to all of the
broken consumers of the malloc interface who assume that the allocated
   address will be an even multiple of the size.
 - Remove disabled time delay code on uma_reclaim().  The comment there said
   it all.  It was not an effective strategy and it should not be left in
   #if 0'd for all eternity.
2003-09-19 23:04:44 +00:00
Marcel Moolenaar fe4723c884 Fix the most significant KSE breakage caused by not restoring the
restart instruction bits in the PSR. As such, we were returning
from interrupt to the instruction in the bundle that caused us
to enter the kernel, only now we're returning to a completely
different bundle.

While close here: add two KASSERTs to make sure that we restore
sync contexts only when entered the kernel through a syscall and
restore an async context only when entered the kernel through an
interrupt, trap or fault.

While not exactly here, but close enough: use suword64() when we
copy the dirty registers from the kernel stack to the user stack.
The code was intended to be be replaced shortly after being added,
but that was a couple of weeks ago. I might as well avoid that it
is a source for panics until it's replaced.
2003-09-19 22:51:26 +00:00
John Birrell 5ec40b82ff Add HP 4400C, Belkin F5U208 VideoBusII 2003-09-19 22:42:51 +00:00
Marcel Moolenaar ebe42add33 Revamp trap(): make it more explicit which kinds of traps/faults we
can get (or not) and what we do with them. This fixes the behaviour
for NaT consumption and speculation faults in that we now don't panic
for user faults.

Remove the dopanic label and move the code to a function. This makes
it easier in the simulator to set a breakpoint.

While here, remove the special handling of the old break-based syscall
path and move it to where we handle the break vector. While here,
reserve a new break immediate for KSE. We currently use the old break-
based syscall to deal with restoring async contexts. However, it has
the side-effect of also setting the signal mask and callong ast() on
the way out. The new break immediate simply restores the context and
returns without calling ast().
2003-09-19 22:41:52 +00:00
Jeff Roberson 64f051e99a - There are an endless stream of style(9) errors in this file. Fix a few.
Also catch some spelling errors.
2003-09-19 22:31:45 +00:00
Sam Leffler 0fd7279efa revert rev 1.64; this is not needed with rev 1.49 of lock.h
as LOCK_DEBUG is implied by MUTEX_PROFILING which stops inline expansion
of the mutex operations

Supported by:	FreeBSD Foundation
2003-09-19 22:03:59 +00:00
Sam Leffler e6e636d539 when MUTEX_PROFILING is enabled turn on LOCK_DEBUG; otherwise all the mutex's
get dumped into a single bucket with line #0 and file NULL

Supported by:	FreeBSD Foundation
2003-09-19 22:01:56 +00:00
Joerg Wunsch 9678710b1f Mention the puc(4) glue driver in a commented-out example so the user
of "dumb" PCI-based serial/parallel boards get a hint how to enable
them.

I wasn't sure about the ia64, pc98, powerpc, and sparc64 archs whether
they'd support puc(4) or not.
2003-09-19 20:04:55 +00:00
Joerg Wunsch 0ec6e98386 Add an entry for the VScom (Titan?) PCI-800L 8-port serial multiport
card.

Thanks to bde for his help in configuring the undocumented bars in
this driver...

MFC after:	1 month
2003-09-19 19:55:08 +00:00
Alexander Kabaev aebbeee812 Eliminate one case of VI_UNLOCK followed by an immediate
VI_LOCK.
2003-09-19 19:13:54 +00:00
Nate Lawson b5155e8fbc This commit was generated by cvs2svn to compensate for changes in r120239,
which included commits to RCS files with non-trunk default branches.
2003-09-19 19:08:55 +00:00
Nate Lawson 050b6a0427 Fix an overflow in the resource list code for Address16, 32, 64, and
extended irq lists.  If the resource has a trailing byte but not the full
resource string, do not attempt to parse the resource string.  This fixes
panics on transition to battery and shutdown for Larry.  Patch has been
submitted to vendor and they will incorporate in next release.

Tested by:	Larry Rosenman <ler@lerctr.org>
PR:		kern/56254
2003-09-19 19:08:55 +00:00
John Baldwin ad27c4c7e0 Document MUTEX_NOINLINE.
Reported by:	sam
2003-09-19 19:04:30 +00:00
John Baldwin afc77db4fc Don't inline mutex operations if MUTEX_PROFILING is enabled.
Reported by:	sam
2003-09-19 18:59:52 +00:00
Thomas Quinot 6ff17a79aa (atapi_action): avoid memory leak in a marginal invalid ccb case.
(free_hcb): defend against calling TAILQ_REMOVE on an hcb that was
 not inserted on pending_hcbs.
2003-09-19 16:25:44 +00:00
Tim J. Robbins 3ddaef4034 Allow the KERN_PROC_PROC sysctl to be used without the useless 4th
name component, for consistency with KERN_PROC_ALL. Support for the
4-argument form will be removed some time before 5.2-R.
2003-09-19 14:16:50 +00:00
Søren Schmidt 4cb5b1f936 Always check the sensekey field on ATAPI returns
Add INQUIRY to cmd2str.
2003-09-19 12:46:12 +00:00
Jeff Roberson 44eca34adb - Don't inspect the zone in page_alloc(). It may be NULL.
- Don't cache more items than the zone would like in uma_zalloc_bucket().
2003-09-19 09:22:04 +00:00
Jeff Roberson 45bf76f0f8 - Move the logic for dealing with the uma_boot_pages cache into the
page_alloc() function from the slab_zalloc() function.  This allows us
   to unconditionally call uz_allocf().
 - In page_alloc() cleanup the boot_pages logic some.  Previously memory from
   this cache that was not used by the time the system started was left in
   the cache and never used.  Typically this wasn't more than a few pages,
   but now we will use this cache so long as memory is available.
2003-09-19 08:53:33 +00:00
Jeff Roberson b60f5b794e - Fix the silly flag situation in UMA. Remove redundant ZFLAG/ZONE flags
by accepting the user supplied flags directly.  Previously this was not
   done so that flags for the same field would not be defined in two
   different files.  Add comments in each header instructing future
   developers on how now to shoot their feet.
 - Fix a test for !OFFPAGE which should have been a test for HASH.  This would
   have caused a panic if we had ever destructed a malloc zone.  This also
   opens up the possibility that other zones could use the vsetobj() method
   rather than a hash.
2003-09-19 08:37:44 +00:00
Marcel Moolenaar d6c3e38bb2 Change TRAPF_USERMODE and CLOCKF_USERMODE to not test for CPL == 3,
but for CPL != 0. For some reason yet unknown it is possible for the
CPL to be 2. This would previously be counted as kernel mode, which
resulted in nasty panics. By changing the test it is now treated as
user mode, which is more correct. We still need to figure out how it
is possible that the privilege level can be 2 (or 1 for that matter),
because it's not used by us. We only use 3 (user mode) and 0 (kernel
mode).
2003-09-19 07:48:22 +00:00
Jeff Roberson 961647dfd0 - Don't abuse M_DEVBUF, define a tag for UMA hashes. 2003-09-19 07:23:50 +00:00
Jeff Roberson b983089a05 - Eliminate a pair of unnecessary variables. 2003-09-19 06:41:06 +00:00
Jeff Roberson cae33c1429 - Initialize a pool of bucket zones so that we waste less space on zones that
don't cache as many items.
 - Introduce the bucket_alloc(), bucket_free() functions to wrap bucket
   allocation.  These functions select the appropriate bucket zone to
   allocate from or free to.
 - Rename ub_ptr to ub_cnt to reflect a change in its use.  ub_cnt now reflects
   the count of free items in the bucket.  This gets rid of many unnatural
   subtractions by 1 throughout the code.
 - Add ub_entries which reflects the number of entries possibly held in a
   bucket.
2003-09-19 06:26:45 +00:00
Alan Cox 45ae1d9147 Merge vm_pageout_free_page_calc() into vm_pageout(), eliminating some
unneeded code.
2003-09-19 05:03:45 +00:00
Jeff Roberson 9fb535dec5 - Only use UMA to cache malloc requests up to PAGE_SIZE. Values larger than
this are requested very infrequently and waste memory when we cache
   spares.
2003-09-19 04:39:08 +00:00
Bill Paul 6110675fd6 Remove jumbo buffer #defines that I ended up not needing. 2003-09-19 02:35:03 +00:00
Sam Leffler f4659f863c add Atheros driver 2003-09-19 01:42:24 +00:00
Marcel Moolenaar 549ab7a654 Include "opt_kstack_pages.h". We export KSTACK_PAGES to assembly and
better have the right value.
2003-09-19 00:37:41 +00:00
Bill Paul 7cae6651cf In re_diag(), there's no need for us to call re_start() ourselves:
IF_HANDOFF() does it for us behind the scenes. Remove the extra call
to re_start() otherwise we try to transmit twice.

In re_encap(), fix the code that guards against consuming too many
descriptors in the TX ring so that it actually works. With the
new 8169S chip, I was able to hit a corner case that drained the
free descriptor count all the way to 0. This is not supposed to
be possible.
2003-09-18 18:32:15 +00:00
Hajimu UMEMOTO 66476d45b8 one more opossite conditiion.
Reported by:	"lg" <zevlg@yandex.ru>
2003-09-18 17:26:56 +00:00
John Baldwin eb975edd06 Fix a busted constant related to PCI configuration acess method #1. The
reserved bits in the port that must be zero are 24:30, not 20:30.  Bits
16:23 are used to set the bus number.  This meant that when we tested for
config mechanism #1, if the previous PCI configuration transaction sent
used a bus number greater than 15, one of the bits in 20:23 would be
non-zero and we would fail to use config mechanism #1 and thus fail to see
that PCI existed on the machine at all.

Obtained from:	Shanley's PCI System Architecture book
Tested by:	des
Proxied through:	njl
2003-09-18 17:00:03 +00:00
Søren Schmidt 015aa7376b Cosmetics 2003-09-18 16:44:54 +00:00
Søren Schmidt 228800a5a7 Be a bit more restrictive in the probe so we dont hang around
on empty channels in most cases.
2003-09-18 16:43:08 +00:00
David E. O'Brien d69e50be45 Support the Hawking Technology's UF100 Pegasus II 10/100 USB Ethernet. 2003-09-18 15:41:07 +00:00
Yoshihiro Takahashi 6c04a4a3dd Merged from sys/isa/fd.c revisions 1.259 and 1.260. 2003-09-18 09:49:08 +00:00
Søren Schmidt 52725a453f Properly handle error code returns from the lower levels ATAPI code. 2003-09-18 09:22:14 +00:00
Bruce Evans ca77329ecc Fixed most of the remaining style bugs in rev.1.194. Mainly better
wording in comments.
2003-09-18 07:46:40 +00:00
Bruce Evans b6fab1eae2 Don't forget to reenable interrupts after a breakpoint and trace traps from
user mode.  This goes with rev.1.468 of machdep.c which changed the gates
for these traps to interrupt gates.  Having the interrupts disabled for
these traps from user mode is just an unwanted side effect.

This fixes at least 1 case of "panic: absolutely cannot call
smp_ipi_shootdown with interrupts already disabled".  Too much code was
run with interrupts disabled, and it sometimes hit a sanity check.

Fix verified by:	deischen
2003-09-18 07:01:30 +00:00
Nate Lawson 6c0e8467af Add necessary newlines. 2003-09-18 05:12:45 +00:00
Nate Lawson a0e5a00957 Shorten the message announcing fixed power/sleep buttons. 2003-09-18 05:01:03 +00:00
Alan Cox 417a26a154 Add vm object locking to vnode_pager_lock(). (This triggers the movement
of a VM_OBJECT_LOCK() in vm_fault().)
2003-09-18 02:26:03 +00:00
Sam Leffler 598345da4b Bandaid locking change: mark static rule mutex recursive so re-entry when
sending an ICMP packet doesn't cause a panic.  A better solution is needed;
possibly defering the transmit to a dedicated thread.

Observed by:	"Aaron Wohl" <freebsd@soith.com>
2003-09-17 22:06:47 +00:00
Sam Leffler f34f3a7097 shuffle code so we don't "continue" and miss a needed unlock operation
Observed by:	Wiktor Niesiobedzki <w@evip.pl>
2003-09-17 21:13:16 +00:00
John Baldwin 4da51cdd8c Bump FreeBSD_version to note that ports that want constants for the
16550 should use <dev/ic/ns16550.h> rather than <dev/sio/sioreg.h>
2003-09-17 20:37:02 +00:00
Sam Leffler fd9469f628 fix build on 64-bit platforms 2003-09-17 18:14:49 +00:00
Bruce Evans aca282e269 Miscellaneous minor style fixes (mainly for unsorting of the flags access
macros).
2003-09-17 17:26:00 +00:00
Bruce Evans 42d3393791 Fixed bitrot in the probe in revs.1.127, 1.165 and 1.169. The
COM_NOFIFO() and COM_ESP cases are supposed to be a subsets of the
plain 16550A case, but 16650-related changes made the former fall into
the latter and then both fall into general code for printing the tx
fifo size.  This mainly caused hard to parse boot messages like:
"sio0: type 16550A fifo disabled lookalike with 1 bytes FIFO".
COM_NOFIFO() on an ESP port gave a larger mess whose extent is not
clear.

Fixed some nearby style bugs.
2003-09-17 16:44:02 +00:00
Bruce Evans cd3aaf0e7c Cleaned up initialization of hardware flow control for 16650As. Use
defined values instead of hard-coded values.  Don't repeat the register
access part of the code 4 times times or triple-space statements.  This
fixes half of the style bugs in rev.1.172.

Hardware flow control of 16650As is still officially unsupported.  I
was mistaken about it being broken.  It is broken in 16650s but is
fixed in 16650As except for the maximum trigger level (which is no
longer used).  Testing of the 16650's broken hardware flow control
watermarks by programming them on 16950s showed that their effects are
not too bad if the fifo size and trigger level are reasonably large
(16 is much better than 8).
2003-09-17 14:05:16 +00:00
Hajimu UMEMOTO eb159f5b2e condition of padLen check was opposite.
Reported by:	"lg" <zevlg@yandex.ru>
Reviewed by:	Lev Walkin <vlm@netli.com>
2003-09-17 08:51:43 +00:00
Mitsuru IWASAKI d099a9d164 Add final adjustment code of battery status based on the battery capacity
rather than returning unknown status.
2003-09-17 08:47:39 +00:00
Mitsuru IWASAKI 526b5e659d Add pci_resume() to reestablish interrupt routing after
suspend/resume.
Especially after hibernation, interrupt routing went back to initial
status on some machines.
2003-09-17 08:32:44 +00:00
Poul-Henning Kamp a2f19df9cc Pick up softc from dev_t rathern than through newbus gymnastics. 2003-09-17 07:40:00 +00:00
Poul-Henning Kamp f967c4f96e Since it is static these days, there is no reason to uppercase the
first letter of fdopen() to avoid nameclashing with other stuff.
2003-09-17 07:21:20 +00:00
Alan Cox 1dabe30610 Remove GIANT_REQUIRED from vm_object_shadow(). 2003-09-17 07:00:14 +00:00
Alan Cox 4b5f553179 When calling vget() on a vnode-backed vm object, acquire the vnode
interlock before releasing the vm object's lock.
2003-09-17 06:55:42 +00:00
Marcel Moolenaar 44ed791b92 In uart_intr() loop until all interrupts have been handled. Previously
an UART interface could get stuck when a new interrupt condition
arose while servicing a previous interrupt. Since an interrupt was
already pending, no new interrupt would be triggered.

Avoid infinite recursion by flushing the Rx FIFO and marking an
overrun condition when we could not move the data from the Rx
FIFO to the receive buffer in toto. Failure to flush the Rx FIFO
would leave the Rx ready condition pending.

Note that the SAB 82532 already did this due to the nature of the
chip.
2003-09-17 03:11:32 +00:00
Marcel Moolenaar 8225548ebf Only build the ebus driver on sparc64. It includes a header directly
from the sparc64 subtree, which breaks building non-sparc64 platforms
in the event the sparc64 subtree does not exist.
The problem is specific to the module, because non-module builds are
affected by the presence or absence of "device ebus" in the kernel
configuration.

PR: kern/56869
2003-09-17 03:00:08 +00:00
Eric Anholt f704d34677 Fix a typo in r1.8: The GTLB enable/flush bit is 1<<7, not 1<<8.
PR:		kern/56297
Submitted by:	Dan Angelescu <mrhsaacdoh@yahoo.com>
2003-09-17 02:58:17 +00:00
Marcel Moolenaar 06287620b4 Add locking to the hardware drivers. I intended to figure out more
precisely where locking would be needed before adding it, but it
seems uart(4) draws slightly too much attention to have it without
locking for too long.
The lock added is a spinlock that protects access to the underlying
hardware. As a first and obvious stab at this, each method of the
hardware interface grabs the lock. Roughly speaking this serializes
the methods. Exceptions are the probe, attach and detach methods.
2003-09-17 01:41:21 +00:00
Bruce Evans 6ab09ca79b Fixed world breakage in previous commit. Somehow the wrong include was
removed in the world although the correct one was removed in the universe.
2003-09-17 01:09:10 +00:00
Sam Leffler 293941a556 Add locking.
o change timeout to MPSAFE callout
o restructure rule deletion to deal with locking requirements
o replace static buffer used for ipfw control operations with malloc'd storage

Sponsored by:	FreeBSD Foundation
2003-09-17 00:56:50 +00:00
Sam Leffler 91176902bc Minor fixups + add locking.
o change time to MPSAFE callout
o make debug printfs conditional on DUMMYNET_DEBUG and runtime controllable
  by net.inet.ip.dummynet.debug
o make boot-time printf dependent on bootverbose

Sponsored by:	FreeBSD Foundation
2003-09-17 00:54:04 +00:00
Sam Leffler e636fe824a Minor overhaul and add locking.
o replace magic constants with #defines (e.g. ETHER_ADDR_LEN)
o move mib variables to net.link.ether.bridge with backwards compatible
  entries for well-known items maintained under BURN_BRIDGES
o revamp debugging support so it is conditioanlly compiled with BRIDGE_DEBUG
  (on currently) and runtime controlled by net.link.ether.bridge.debug
o change timeout to MPSAFE callout
o optimize lookup for common case of two interfaces
o optimize forwarding path to take IFNET lock only when needed
o make boot-time printf dependent on bootverbose
o sundry style changes (ANSI decls, extraneous spaces, etc.)

Sponsored by:	FreeBSD Foundation
2003-09-17 00:50:33 +00:00
Scott Long 7753acd255 Correctly wrap the producer queue index when dequeuing commands. This wasn't
a problem for command responses since we rarely ever filled the queue.
However, adapter-initiated commands have a much smaller queue and could
tickle this bug.  It's possible that this might fix the recently reported
problems with the aac-2120s, though I haven't been able to reproduce the
problem locally.

MFC-After: 1 day
2003-09-16 16:07:15 +00:00
Søren Schmidt 855deec44c When ignoring interrupts (due to no running request set) then try
to grap the channel so we can read status (and clear an evt pending
interrupt).
2003-09-16 15:21:37 +00:00
Søren Schmidt 853c84ddf6 Rearrange the probe a bit first try ATAPI signatures then ATA. 2003-09-16 15:16:36 +00:00
Søren Schmidt 77de5988d6 Properly cast longs to off_t so we dont loose precision. 2003-09-16 14:41:44 +00:00
Bruce Evans efcfe95173 Added definitions of most of the interesting 16950 register numbers
and some of their bits (i.e., fifo trigger levels, frequency multipliers
and divisors, and bits to select the registers for these).  This
attempts to completely describe the 16950's complicated register selects
for 16950-specific registers only.
2003-09-16 14:21:17 +00:00
Bruce Evans fec27f507c Added definitions for some 16650 features (mostly misfeatures). This
completes defining the 16650 register numbers but not all of their bits.
2003-09-16 14:08:54 +00:00
Bruce Evans 2b843bc94b Fixed a minor error in the description of the EFR and a major error in
the description of the data latch registers (they were described as
readonly).

Added some better and worse aliases for standard registers, mostly taken
from the 16950 data sheet.  Define deprecated aliases in terms of the
preferred one.

Don't define com_efr in terms of com_fifo.  It is unrelated (in a
different bank).
2003-09-16 13:52:01 +00:00
Bruce Evans 74814b322a Sorted register numbers together with the correspoding register bits.
Merged comments to match (put them at the right of the #defines instead
of duplicating them).

Sorted the resulting sections on UART type and register bank.  Added a
comment for each bank.
2003-09-16 11:54:29 +00:00
Bruce Evans bb44220efa Don't repeat selected defines from ns16550.h or sioreg.h. Just
include ns16550.h.  The missing installation of ns16550.h was fixed
long ago and the misplaced defines in sioreg.h were fixed recently.
2003-09-16 11:24:23 +00:00
Bruce Evans 4b60a21e0c Don't include another driver's private reg.h file (sioreg.h). Including
ns16550.h is now sufficient.
2003-09-16 11:04:22 +00:00
Bruce Evans 86fe87393a Moved the definitions of the bits in the ns*50 registers from sioreg.h
to ns16550.h.  The organization of these files was sort of backwards.
The bits in the registers have no driver or bus dependencies but they
but the offsets of the registers in bus space are very bus-dependent.
However, it does no harm to keep the definitions of the register offsets
in ns16550.h provided they are thought of as internal ns*50 offsets.
2003-09-16 08:08:08 +00:00
Martin Blapp 129eaf7996 Don't read the MAC address from a copy of the EEPROM in the softc
that has been recorded earlier and overwrite it again later by
reading it directly from the EEPROM again.

Read the MAC address from the PAR0/PAR1 registers instead, which
are autoloaded on reboot.

Tested on AN985, AN983B. According to the datasheets, it should
also work for the AL981 (I don't have such a chip on a card at home)

PR:             52988
Submitted by:   Andrew Gordon <arg-bsd@arg.me.uk>
MFC after:      2 weeks
2003-09-16 05:01:27 +00:00
David E. O'Brien 67193a54f0 Statically compile in sound as we don't have modules yet. 2003-09-15 22:40:00 +00:00
Sam Leffler de5af70460 Maintain a history of data associated with received frames and use this to
calculate smoothed signal quality data for each node.

o add a 16-deep history buffer to each driver-private node storage that
  holds rssi and antenna info for received frames
o override the default per-node "get rssi" method to return an average
  rssi value based on samples collected over the last second
o enable beacon reception so even idle systems maintain a running history
  of signal quality

This data may also be useful for improving the rate control algorithm.
Based on work by Tom Marshall <tommy@home.tig-grr.com> for MADWIFI.
2003-09-15 22:34:46 +00:00
Sam Leffler d1e61976a0 Generalize the per-node RSSI data so drivers can do more interesting
things than record a single value.

o add a per-node method for returning the "current RSSI" for a node
o create a default method that returns ni_rssi which is the rssi for
  the last received frame
o use the per-node "get rssi" method to return data for the RID's
  submitted by wicontrol, et. al.

Loosely based on work by Tom Marshall <tommy@home.tig-grr.com> for MADWIFI.
2003-09-15 22:28:07 +00:00
Nate Lawson c87cfaedf2 Bump the EC timeout from 50 to 100 ms. I believe the underlying issue is
global lock contention as symptoms only appear under heavy load (i.e. the
nightly periodic run).
2003-09-15 21:20:55 +00:00
Nate Lawson feec6a7a90 Correctly reset ich[3-5] sound cards on resume. This fixes audio playback
after suspend/resume for me.

PR:
Submitted by:	iwasaki
Reviewed by:	orion
Approved by:	cg
Obtained from:
MFC after:
2003-09-15 21:16:47 +00:00
Sam Leffler ecddff40a0 o do not filter received frames based on type or length; pass 'em all up
to the 802.11 layer if they are at least IEEE80211_MIN_LEN
o mask off interrupt status bits that we don't care about so we don't do
  the wrong thing; this fixes a problem where the beacon miss interrupt status
  bit is delivered together with other status bits when operating in monitor
  mode (we would post a beacon miss swi and then do the wrong thing)
2003-09-15 19:41:54 +00:00
Sam Leffler 18f897abe0 Change input handling to not expect drivers to filter short frames.
In particular, let drivers send up control frames so we can dispatch
them to bpf in monitor mode.

This is the first (small) step to adding more functionality such as
power save mode.
2003-09-15 19:38:29 +00:00
Sam Leffler 993338b6ab add definitions for various control frames and a minimum-sized frame that
we use to define IEEE80211_MIN_LEN; the minimal length for frames drivers
may pass up into the 802.11 layer
2003-09-15 19:36:34 +00:00
Bruce Evans 7c24ca50f8 Quick fix for a pessimization in rev.1.194. An extra i/o instruction
was added to the fast path to support the COM_IIR_RXRDYBUG() case even
when that case is not configured.  This increased the relative overhead
of sio input by almost 25% in the worst case and by 2-3% in the usual
case (usually only about 0.2% absolute per port at 115200 bps).  The
quick fix is to significantly pessimize only the COM_IIR_RXRDYBUG()
case.
2003-09-15 13:49:18 +00:00
Mark Murray 56c5b842f0 Add a module dependancy. Now CAM will autoload when you load this.
OK'ed by:	mdodd
2003-09-15 06:41:33 +00:00
Nate Lawson 2d610c4638 Only enable S4BIOS by default if the FACS says it is available. The
user can override this with a sysctl.

Be sure to return the acpi_SetSleepState return value to userland.
2003-09-15 06:29:31 +00:00
Alan Cox 82f9defeaf Eliminate the use of Giant from vm_object_reference(). 2003-09-15 05:58:27 +00:00
Marcel Moolenaar 991e61c934 Sort: build uart_bus_pccard.c before uart_bus_pci.c. 2003-09-15 04:53:11 +00:00
Marcel Moolenaar 39e7b60930 Remove inclusion of <sys/timepps.h>. It's included in "uart_bus.h"
to avoid having to include it in almost all other source files.
2003-09-15 04:49:22 +00:00
Takanori Watanabe 45b3a50925 Remove useless #ifdef PC98.
Submitted by: nyan
2003-09-15 03:12:27 +00:00
Alan Cox 35b86dc8de Correct a typo in the previous revision. 2003-09-15 02:56:48 +00:00
Sam Leffler 3065b96e25 must also check for 5Ghz channels when marking short preamble capability in
the beacon frames

Reminded by:	Stephane Laroche <stephane.laroche@colubris.com>
2003-09-14 22:53:41 +00:00
Sam Leffler f6aa038bbe o mark the device capable of short preamble (meaningless for the 5210 but
safe since the 802.11 layer does the right thing for 11a operation)
o select short preamble operation based on the negotiated capabilities; not
  just the local state/capability
o fillin the duration field in the 802.11 header as appropriate
o remove detection of 11g support; no longer needed

Obtained from:	MADWIFI (with modifications)
2003-09-14 22:39:19 +00:00
Sam Leffler 4f2e09c4b2 Honor the short preamble capability/state flag when calculating the
capabilities for outbound management frames.  But beware of sending
this when operating on 5GHz channels; some 11a AP's reject association
requests if this bit is set in the capabilities listed.

Obtained from:	MADWIFI (with modifications)
2003-09-14 22:34:24 +00:00
Sam Leffler fba3db9f57 short preamble capability is not just for 11g; mark IEEE80211_F_SHPREAMBLE
regardless of the operating mode

Obtained from:	MADWIFI
2003-09-14 22:32:18 +00:00
Scott Long ec40a9f9d0 Teach the PCI code to parse MSI extended capabilities. Re-arrange the
pcicfg struct a bit to hold extcap structures instead of structure members.
2003-09-14 19:30:00 +00:00
Nate Lawson 5f7e1e2f82 Print notify values as hex. 2003-09-14 17:47:44 +00:00
Takanori Watanabe 0d62746979 Add uart pccard attachment decription on conf/files, too.
Pointed out by: ru
2003-09-14 17:02:59 +00:00
Matthew N. Dodd cdeb7b18af - Avoid calling pci_get_device() more than once in a single function.
- Provide a mechanism to prevent the use of MMIO.
- Prevent the use of MMIO for all 3c575 cardbus cards.
2003-09-14 16:33:48 +00:00
Takanori Watanabe a9f6e997b5 Add uart pccard bus attachment,based on sio_pccard.c .
Wrote at: Hakone.
Powered by: Warner Losh's scotch whisky.
Tested by: nork
2003-09-14 16:21:06 +00:00
Scott Long 3c358d0ca0 Expand the extended capabilities list and add definitions for MSI. 2003-09-14 14:42:26 +00:00
Robert Watson 62c45ef40a Add a new sysctl, security.bsd.conservative_signals, to disable
special signal-delivery protections for setugid processes.  In the
event that a system is relying on "unusual" signal delivery to
processes that change their credentials, this can be used to work
around application problems.

Also, add SIGALRM to the set of signals permitted to be delivered to
setugid processes by unprivileged subjects.

Reported by:	Joe Greco <jgreco@ns.sol.net>
2003-09-14 07:22:38 +00:00
Scott Long cadbc399ea Remove most of the magic constants from the extcap parsing code. 2003-09-14 06:23:19 +00:00
Alan Cox 30bb12a4e8 Call vm_page_unmanage() on pages belonging to the kmem_object. This
eliminates the unnecessary overhead of managing "PV" entries for these
pages.
2003-09-14 02:37:59 +00:00
Matthew N. Dodd 2049fdeefd Enable IPv6 for Token Ring. 2003-09-14 02:32:31 +00:00
Matthew N. Dodd f8f1abafd2 Cosmetic cleanups. 2003-09-14 02:26:45 +00:00
Matthew N. Dodd 5dbc58b5ba Cosmetic adjustment. 2003-09-14 02:18:54 +00:00
Bill Paul c2c6548b3a Teach the re(4) driver about the CFG2 register, which tells us whether
we're on a 32-bit/64-bit bus or not. Use this to decide if we should
set the PCI dual-address cycle enable bit in the C+ command register.
(Enabling DAC on a 32-bit bus seems to do bad things.)

Also, initialize the C+ command register early in the re_init() routine.
The documentation says this register should be configured first.
2003-09-13 23:51:35 +00:00
Bill Paul dcdc6667ce The in6_ifattach() routine contains the following code:
in6_pcbpurgeif0(LIST_FIRST(udbinfo.listhead), ifp);
        in6_pcbpurgeif0(LIST_FIRST(ripcbinfo.listhead), ifp);

The problem here is that udbinfo.listhead and ripcbinfo.listhead are
not initialized during the device probe/attach phase of the kernel
boot process. So if, for example, a network driver calls ether_ifattach()
in its foo_attach() routine and then decides that something is wrong
and calls ether_ifdetach() to reverse the process, we will panic trying
to dereference the uninitialized list head pointers. (Though the
same sequence of events performed after the kernel has come up works
file, i.e. doing kldload if_foo from multiuser.)

Change this to:

        if (udbinfo.listhead != NULL)
                in6_pcbpurgeif0(LIST_FIRST(udbinfo.listhead), ifp);
        if (ripcbinfo.listhead != NULL)
                in6_pcbpurgeif0(LIST_FIRST(ripcbinfo.listhead), ifp);

to avoid the NULL pointer dereferences.
2003-09-13 22:34:52 +00:00
Alan Cox 6d66d714c7 Simplify (and micro-optimize) pmap_unuse_pt(): Only one caller,
pmap_remove_pte(), passed NULL instead of the required page table
page to pmap_unuse_pt().  Compute the necessary page table page
in pmap_remove_pte().  Also, remove some unreachable code from
pmap_remove_pte().
2003-09-13 21:57:38 +00:00
Nate Lawson 64fdad2352 Add the -i flag to acpiconf(8) to retrieve battery information.
Rename a few structure elements.
2003-09-13 20:13:01 +00:00
Alan Cox b881da26a5 There is no need for an atomic increment on the vm object's generation
count in _vm_object_allocate().  (Access to the generation count is
governed by the vm object's lock.)  Note: the introduction of the
atomic increment in revision 1.238 appears to be an accident.  The
purpose of that commit was to fix an Alpha-specific bug in UMA's
debugging code.
2003-09-13 20:07:26 +00:00
Jacques Vidrine 5949ba2136 sched_setscheduler: Return EINVAL when a invalid policy is specified,
thus complying with POLA and the man page.  (Previously, no error was
returned for this case.)
2003-09-13 18:46:24 +00:00
Scott Long ba42f5be52 Apply Aleksander Fafula's crayons to the beastie. Add the this line to
/boot/loader.conf to see the pretty colors =-)

loader_color="YES"
2003-09-13 18:35:01 +00:00
Jacques Vidrine b5e80ae344 Correct mostly harmless off-by-one error in getdomainname().
Reviewed by:	imp
2003-09-13 17:12:22 +00:00
Yoshihiro Takahashi 211822ccef Merged from sys/isa/fd.c revision 1.258. 2003-09-13 12:56:05 +00:00
Marcel Moolenaar 84c7b427f5 Add support for automatic hardware flow control for 16[679]50 UARTs.
We simply use the detected FIFO size to determine whether we have
a post 16550 UART or not. The support lacks proper serialization of
hardware access for now.
2003-09-13 06:25:04 +00:00
Alan Cox 58abfe0051 Convert vmapbuf() from using pmap_extract() to using
pmap_extract_and_hold().  Note, however, that GIANT_REQUIRED should not be
removed until all platforms fully implement the "prot" parameter to
pmap_extract_and_hold().

Reviewed by:	tegge
2003-09-13 04:29:55 +00:00
Matt Jacob 53d0345138 I forgot whom I got this from- only set single initiator buffered mode
if we've recorded in our softc that we should set it.
2003-09-13 02:01:56 +00:00
Matt Jacob 4b39f27d17 NetBSD'er with time on their hands (dma->DMA) 2003-09-13 01:59:14 +00:00
Matt Jacob 799cbab17e Bland synchronization of common source with no effect on FreeBSD whatsomever. 2003-09-13 01:58:51 +00:00
Matt Jacob 2f9e7606fe Some ridiculous target mode botches- like having the wrong definitions
for messages. Some spelling fixes. Some target mode structure cleanups
to reflect reality.
2003-09-13 01:58:26 +00:00
Matt Jacob 5c1596a04a Some canonicalization function cleanups based upon some target mode
structure cleanups.
2003-09-13 01:57:31 +00:00
Matt Jacob 4578084aa3 No time like the present to turn back on SMP locking. 2003-09-13 01:56:45 +00:00
Matt Jacob fd6eb9f769 Report correct active vs. nvram node/port WWNs in an ioctl. 2003-09-13 01:56:24 +00:00
Matt Jacob 28f0575cf1 On reset, make sure that we have some parameters set correctly. This
fixes a longstanding issue WRT resetting the chip after startup- it
would fail if we were connected as an F-port to a switch. If we
were connected as an F-port, we got assigned a hard loop ID of 255,
which is really a bogus loop id. Then when we turned around to
reset ourselves, the firmware would reject the ICB_INIT request
because the loop id was bogus. *sputter*

Minor fixlet from somebody in NetBSD with too much time on their
hands (dma -> DMA).
2003-09-13 01:55:44 +00:00
Tim J. Robbins 5f39b226ce Move an overly verbose message under #ifdef CODA_VERBOSE. 2003-09-13 01:13:56 +00:00
Thomas Moestl 09c06ee91f When determining the device class to use for the serial console, check
the "compatible" property too in the ns8250 case. This gets the serial
console to work on Blade 100s, where the device name is just "serial".

Reviewed by:	marcel
2003-09-12 20:13:23 +00:00
Thomas Moestl 894b85b150 Handle ISA devices in OF_decode_addr(), with the same code that is
used in the EBus case.
2003-09-12 20:04:29 +00:00
Poul-Henning Kamp 2a3d23acc6 Name the vnode method vectors consistently with the rest of the filesystems.
This improves the output of src/tools/tools/vop_table
2003-09-12 16:44:40 +00:00
Alan Cox 27d203eab3 pipe_build_write_buffer() only requires read access of the page that it
obtains from pmap_extract_and_hold().
2003-09-12 07:13:15 +00:00
Alan Cox b9850eb224 Add a new parameter to pmap_extract_and_hold() that is needed to eliminate
Giant from vmapbuf().

Idea from:	tegge
2003-09-12 07:07:49 +00:00
Paul Saab faf13262a4 Delay most of the adapter initilization until after interrupts are
enabled.

Tested by:	Richard Puga <puga@mauibuilt.com>
2003-09-11 23:30:28 +00:00
Marcel Moolenaar 8194412b89 Add support for using uart(4) for pulse capturing for the Pulse Per
Second (PPS) timing interface. The support is non-optional and by
default uses the DCD line signal as the pulse input. A compile-time
option (UART_PPS_ON_CTS) can be used to have uart(4) use the CTS line
signal.

Include <sys/timepps.h> in uart_bus.h to avoid having to add the
inclusion of that header in all source files.

Reviewed by: phk
2003-09-11 23:06:42 +00:00
Ruslan Ermilov 78f94aa951 Fix a bunch of off-by-one errors in the range checking code. 2003-09-11 21:40:21 +00:00
Poul-Henning Kamp 0c7721e8f9 Disable the use of cloning use in floppy and CD drivers.
This commit puts the relevant code snippets under #ifdef GONE_IN_5
(rather than #ifndef BURN_BRIDGES) thereby disabling the code now.

The code wil be entirely removed before 5.2 unless we find reasons
why this would be a bad idea.

Approach suggested by:	imp
2003-09-11 19:27:24 +00:00
Thomas Quinot cc9ed6619f (atapi_action, case XPT_PATH_INQ): Handle properly the case of
CAM_TARGET_WILDCARD (target_id_t is an unsigned integer type).
Fixes boot-time crash on Alpha.

Reviewed by:	roberto
Approved by:	re (murray)
MFC after:	1 week
2003-09-11 17:34:47 +00:00
Søren Schmidt fe78f9d47c Add support of the DIOCGSECTORSIZE & DIOCGMEDIASIZE ioctl's
so that newfs works on dvd-rw/dvd-ram again..
2003-09-11 15:59:16 +00:00
Yoshihiro Takahashi 8278014bce MFi386 revisions 1.570 and 1.571. 2003-09-11 14:07:02 +00:00
Yoshihiro Takahashi 916a70c619 MFi386: revision 1.204. 2003-09-11 14:05:06 +00:00
Yoshihiro Takahashi c475aa0304 MFi386: revision 1.1093. 2003-09-11 13:44:48 +00:00
Yoshihiro Takahashi 79a5a35f9e Merged from sys/isa/fd.c revisions 1.252, 1.253, 1.254, 1.255 and 1.257. 2003-09-11 13:35:35 +00:00
Bill Paul d5a5045921 Clean up dead code. 2003-09-11 08:28:38 +00:00
Bill Paul 804af9a1af Toggle the interface on and off before starting the diag test. This
seems to be necessary for the 8139C+ under certain circumstances, and
doesn't appear to hurt the other chips. (In the failure case, the
packet would be sent through the TX DMA ring but not get echoed
back. I suspect this has something to do with the link state changing
unexpectedly.)
2003-09-11 07:54:16 +00:00
Bill Paul abc8ff44d3 - For the 8169 chips, read the station address by forcing an EEPROM
autoload and then copying the contends of the station address
  registers. For some reason, reading the EEPROM on the 8169S doesn't
  work right. This gets around the problem, and allows us to read
  the station address correctly on the 8169S.

- Insert a delay after initiating packet transmition in re_diag() to
  allow lots of time for the frame to echo back to the host, and wait
  for both the 'RX complete' and 'timeout expired' bits in the ISR
  register to be set.

- Deal more intelligently with the fact that the frame length
  field in the RX descriptor is a different width on the 8139C+
  than it is on the 8169/8169S/8110S

- For the 8169, you have to set bit 17 in the TX config register
  to enter digital loopback mode, but for the 8139C+, you have to
  set both bits 17 and 18. Take this into account so that re_diag()
  works properly for both types of chips.
2003-09-11 06:56:46 +00:00
Warner Losh 3e49a687ff Minor commentary cleanup, since I didn't understand the comments that
I wrote.
2003-09-11 04:22:28 +00:00
Warner Losh 04ea3df7d9 Fix compile on pc98. Maybe this is correct. 2003-09-11 04:14:26 +00:00
Bill Paul 5c75626b05 Re-enable VLAN_MTU capability for this driver. (Got reverted when
I pulled out the C+/8169 bits.)
2003-09-11 04:05:01 +00:00
Bill Paul 9bac70b851 Add a PHY driver to support the built-in gigE PHY in the 8169S/8110S
ethernet chips. This driver is pretty simple, however it contains
special DSP initialization code which is needed in order to get
the chip to negotiate a gigE link. (This special initialization
may not be needed in subsequent chip revs.) Also:

- Fix typo in if_rlreg.h (RL_GMEDIASTAT_1000MPS -> RL_GMEDIASTAT_1000MBPS)

- Deal with shared interrupts in re_intr(): if interface isn't up,
  return.

- Fix another bug in re_gmii_writereg() (properly apply data field mask)

- Allow PHY driver to read the RL_GMEDIASTAT register via the
  re_gmii_readreg() register (this is register needed to determine
  real time link/media status).
2003-09-11 03:53:46 +00:00
Nate Lawson 5c5967082f Add a system notify handler in addition to the device notify handler.
At least some Toshiba notebooks use a Notify of 0 or 1 for this.

PR:
Submitted by:	Hiroyuki Aizu <aizu@navi.org>
2003-09-11 03:17:33 +00:00
Poul-Henning Kamp e060b6bd03 Reorder a couple of KASSERTS to give more sensible messages.
Found by:	GEOM 101 class of '03
2003-09-11 00:49:02 +00:00
Marcel Moolenaar 87ad0260ff Rewrite the SAPIC initialization to always program the RTEs with what
we think is the correct trigger mode and polarity. This allows us to
implement BUS_CONFIG_INTR() as an update of the RTE in question.
Consequently, we can trust the RTE when we enable an interrupt and
avoids that we need to know about the trigger mode and polarity at
that time.
2003-09-10 22:49:38 +00:00
Marcel Moolenaar 24752c4291 Extend the ACPI resource handling to make use of the BUS_CONFIG_INTR()
method. This is necessary on ia64 where it's known that serial interfaces
described in the ACPI namespace may not have the well-known IRQs assigned
to them. This confuses us in thinking they are PCI based interrupts and
wrongly program the APIC.
2003-09-10 22:06:41 +00:00
Marcel Moolenaar da13b8f9fe Introduce BUS_CONFIG_INTR(). The method allows devices to tell parents
about interrupt trigger mode and interrupt polarity. This allows ACPI
for example to pass interrupt resource information up the hierarchy.
The default implementation of the method therefore is to pass the
request to the parent.

Reviewed by: jhb, njl
2003-09-10 21:37:10 +00:00
David E. O'Brien 39e5f914ee Relent and back out rev 1.15. 2003-09-10 19:08:16 +00:00
David E. O'Brien 3fc40c2484 Sort 'bge' correctly. 2003-09-10 18:54:59 +00:00
Alan Cox 8373f36dbb In case vmapbuf() fails, release all of the held resources.
Submitted by:	tegge
2003-09-10 18:23:43 +00:00
Hidetoshi Shimokawa 8edbaf859d Fix asynchronous physio breakage introduced in rev 1.163.
We cannnot use bp->b_caller2 because DEV_STRATEGY will overwrite it.
2003-09-10 15:48:51 +00:00
Bill Paul 4ee1666125 Fix bug in re_gmii_writewreg(): we don't need to be screening out certain
PHY addresses here. (The chip will only let you talk to one PHY anyway.)
2003-09-10 15:14:46 +00:00
Bill Paul 966a07e907 Teach rl(4) about new hwrev codes. 2003-09-10 15:12:55 +00:00
Søren Schmidt 2194b6a479 Try a bit harder to probe disks that doesn't quite set BUSY right. 2003-09-10 09:57:16 +00:00
Bill Paul 69a6b7fb50 Update hardware revision table. 0x04000000 appears to be the revision
for the 8169S, according to my sample board. The RealTek Linux driver
mentions 0x00800000. I'm assigning this to the 8110S until I get
more info on it. (The (preliminary) RealTek docs only say that 8169S/8110S
chips will have some combination of those two bits set, but doesn't say
exactly what bit combination goes with which chip variant.)
2003-09-10 07:21:43 +00:00
John Baldwin bbdaad6fee Whitespace. 2003-09-10 07:09:16 +00:00
John Baldwin 42a12b2bd8 Move the definitions for ACPI MADT table entries not present in the ACPICA
distribution to a MI header so it can be shared with other architectures.
2003-09-10 06:32:27 +00:00
John Baldwin 810cb9ef5e We represent PCI intpin's two different ways. One is the way that the
intpin register is expressed in hardware where 0 means none, 1 means INTA,
2 INTB, etc.  The other way is commonly used in loops where 0 means INTA,
1 means INTB, etc.  The matchpin argument to pci_cfgintr_search() is
supposed to be the first form, but we passsed in a loop index of the
second.  This fix adds one to the loop index to convert to the first form.

Reported by:	Pavlin Radoslavov <pavlin@icir.org>
2003-09-10 06:00:53 +00:00
John Baldwin a7321ecb19 Finish an earlier commit:
Add a acpi_SetDefaultIntrModel() method to allow drivers to set the
interrupt model prior to the acpi0 device being probed and attached.
2003-09-10 05:29:30 +00:00
Marcel Moolenaar c21e0da2f8 If we failed to size the Rx FIFO, assume the worst. This however
is not a size of 1. Since we already know there is a FIFO, we can
safely assume that it is at least 16 bytes. Note that all this is
mostly academic anyway. We don't use the size of the Rx FIFO
currently. If we add support for hardware flow control, we only
care about Rx FIFO sizes larger than 16.
2003-09-10 05:01:08 +00:00
Tim J. Robbins e1d237ec05 Move an annoying printf() call that gets triggered every time an
operation is interrupted (with ^C or ^Z) under CODA_VERBOSE.
2003-09-10 01:41:15 +00:00
John Baldwin a547af297d Remove an XXX comment by using the per CPU mask added after this comment
was added.
2003-09-10 01:36:48 +00:00
John Baldwin 4c93af3788 Add a acpi_SetDefaultIntrModel() method to allow drivers to set the
interrupt model prior to the acpi0 device being probed and attached.
2003-09-10 01:14:42 +00:00
John Baldwin f03cb48d41 Fix a typo. 2003-09-10 01:11:58 +00:00
John Baldwin 674e1d4532 Add comments to the members of the timecounter struct similar to other
timecounters.
2003-09-10 01:10:24 +00:00
John Baldwin 2b3c42a9e9 Update the license on this file to be a bit more sane. 2003-09-10 01:09:32 +00:00
John Baldwin 0e85b19ba9 Add constants for entries in the IDT and use those instead of magic
numbers.
2003-09-10 01:07:04 +00:00
Ruslan Ermilov 8e75a37bb0 Fixed -Wpointer-arith warning.
Submitted by:	Stefan Farfeleder
PR:		bin/56653
2003-09-09 23:50:57 +00:00
Peter Wemm 2c25d12414 Clean up get/set_mcontext() and get/set_fpcontext(). These are operated
on data structures on the kernel stack which are guaranteed to be 16 byte
aligned by gcc, the amd64 ABI and __aligned(16).

Ensire the tss_rsp0 initial stack pointer is 16 byte aligned in case
sizeof(pcb) becomes odd at some point.  This is convenient for the
interrupt handler case because the ring crossing pushes cause the
required odd alignment before the call to the C code.

Have fast_syscall add an additional 8 bytes to ensure that the trapframe
has the correct odd alignment for the call to C code.  Note that there are
no checks to make sure that the trapframe size is appropriate for this.

This makes get/setfpcontext work properly (finally).  You get a GPF in
kernel mode if any of this is botched without the alignment fixup code
that is apparently needed on i386.
2003-09-09 19:32:09 +00:00
Dag-Erling Smørgrav 7d10d0554c Fix some broken comments. 2003-09-09 19:22:55 +00:00
Marcel Moolenaar 999a2bfab3 Add LOG2_ID_PAGE_SIZE to the mix of options on ia64. 2003-09-09 18:30:20 +00:00
Bill Paul af8512b863 Remove unnecessary #include of brgphyreg.h, left over from when Stuart used
the bge(4) driver as a template.
2003-09-09 18:21:17 +00:00
Bill Paul b9f78d2b4a Add a device driver for the Broadcom BCM4401 ethernet controller,
written by Stuart Walsh and Duncan Barclay (with some kibbitzing by
me). I'm checking it in on Stuart's behalf.

The BCM4401 is built into several x86 laptop and desktop systems. For the
moment, I have only enabled it in the x86 kernel config because although
it's a PCI device, I haven't heard of any standalone NICs that use it. If
somebody knows of one, we can easily add it to the other arches.

This driver uses register/structure data gleaned from the Linux
driver released by Broadcom, but does not contain any of the code
from the Linux driver itself. It uses busdma.
2003-09-09 18:17:23 +00:00
Dag-Erling Smørgrav 0dd872f5bb Add cwd, root and statm (modeled on a 2.4.20 kernel). De-obfuscate
linprocfs_init() a little and remove some gratuitous whitespace.
2003-09-09 08:19:06 +00:00
Scott Long 5b80c0d74d Use PCIR_BAR() instead of a magic offset. 2003-09-09 06:44:58 +00:00
Scott Long 5fdcb0a62e Re-arrange the raid section a small bit and put drivers into their proper
category.
2003-09-09 06:36:32 +00:00
Marcel Moolenaar e6882c3469 Introduce IA64_ID_PAGE_{MASK|SHIFT|SIZE} and LOG2_ID_PAGE_SIZE. The
latter is a kernel option for IA64_ID_PAGE_SHIFT, which in turn
determines IA64_ID_PAGE_MASK and IA64_ID_PAGE_SIZE.

The constants are used instead of the literal hardcoding (in its
various forms) of the size of the direct mappings created in region
6 and 7. The default and probably only workable size is still 256M,
but for kicks we use 128M for LINT.
2003-09-09 05:59:09 +00:00
Nate Lawson 9817561470 Disallow attempts to suspend to S0. It was only enabled for testing.
Print a more informative message if a sleep state is not supported by BIOS.
Add comments.
2003-09-09 04:09:25 +00:00
Eric Anholt a1810e1513 Hook the SiS DRM up to the build
Sponsored by:	LinuxFund
2003-09-09 00:29:02 +00:00
Eric Anholt 6608b729ea Merge from DRI CVS. Includes newly ported SiS 300/305/540/630/730 driver and
updates to allow system memory to be used for textures on PCI Radeons.

Sponsored by:	LinuxFund
2003-09-09 00:24:31 +00:00
Peter Wemm df6ece387b Turn aac back on now that its been cleaned up for 64 bit compilation 2003-09-08 20:00:55 +00:00
Ruslan Ermilov fe08efe680 mdoc(7): Use the new feature of the .In macro. 2003-09-08 19:57:22 +00:00
Poul-Henning Kamp d5ce9dac89 Correct bzero length so we clear the entire key structure. 2003-09-08 18:35:26 +00:00
Poul-Henning Kamp 5fdd8d28a3 Correctly bzero the entire context, not just the first sizeof(void *) bytes.
Found by:	Juergen Buchmueller <pullmoll@stop1984.com>
2003-09-08 18:32:33 +00:00
Peter Wemm 292bbfd103 Argh. This file was completely out of sync with mcontext/trapframe. 2003-09-08 18:31:48 +00:00
Peter Wemm 7fe089a006 Hmm. Two copies of the mcontext... 2003-09-08 18:28:41 +00:00
Paul Saab 88ff7f004e Quiet down boot verbose and allow commands to be submitted to a target
which does not have a volume attached.  This will stop cam from retrying
a bunch of time at boot for devices which do not exsist.
2003-09-08 16:45:33 +00:00
Ian Dowse ffe40c80ea In the !MNT_BYFSID case, return EINVAL from unmount(2) when the
specified directory is not found in the mount list. Before the
MNT_BYFSID changes, unmount(2) used to return ENOENT for a nonexistent
path and EINVAL for a non-mountpoint, but we can no longer distinguish
between these cases. Of the two error codes, EINVAL was more likely
to occur in practice, and it was the only one of the two that was
documented.

Update the manual page to match the current behaviour.

Suggested by:	tjr
Reviewed by:	tjr
2003-09-08 16:23:21 +00:00
Søren Schmidt a127b17621 Add another ID for the SiI3112a SATA chip as used on the Adaptec 1210SA.
RAID support is still in the works, so for now just normal ATA ops.

Sponsored by:	Matt Douhan(www.fruitsalad.org)
2003-09-08 13:55:05 +00:00
Søren Schmidt df63f1d988 Limit the size of the rebuild requests to be within safety. 2003-09-08 13:36:26 +00:00
Tim J. Robbins 9e05721545 Bump __FreeBSD_version for Coda 6.x venus<->kernel API support. 2003-09-08 11:54:59 +00:00
David E. O'Brien 7d4724590e Use __FBSDID().
Also some minor style cleanups.
2003-09-08 09:11:32 +00:00
Søren Schmidt 4514dcad32 #ifdef out the vague ATA disk detection code causing fake ATA disks
to be found on some systems.
Hopefully this doesn't loose any real ATA disks...
2003-09-08 08:36:46 +00:00
Søren Schmidt 08c26854a3 Handle shared channels better.
Try to avoid the spurios interrupts better.
2003-09-08 08:32:25 +00:00